FusionAuth
    • Home
    • Categories
    • Recent
    • Popular
    • Pricing
    • Contact us
    • Docs
    • Login
    1. Home
    2. Tags
    3. search
    Log in to post
    • All categories
    • W

      Solved Troubleshooting Empty Results from FusionAuth User Search API

      Frequently Asked Questions (FAQ)
      • search • • wesley
      2
      0
      Votes
      2
      Posts
      986
      Views

      W

      Your request body looks correct for a basic search by email and should return a result if a user with that exact email address exists in your system.

      1. Ensure You Are Using POST (or Use GET with Query Parameters)

      The /api/user/search endpoint supports both POST and GET, but they expect different input formats.

      If using GET, you must provide query parameters, such as:

      GET /api/user/search?ids=<user_id>

      2. Searching for Partial Matches

      If you want to find all users with a certain email domain, try using a wildcard search:

      { "search": { "queryString": "*@email.com" } }

      3. Verify API Key Permissions

      If you still get empty results, ensure that:

      Your API key has sufficient permissions to query user data. The user records exist in the database.

      4. Further Reading on User Search

      For more details on how to construct search queries, refer to:

      Elasticsearch Search in FusionAuth User Search with Elasticsearch
    • danD

      Searching for users with the java client

      Q&A
      • java client search users • • dan
      2
      0
      Votes
      2
      Posts
      5.4k
      Views

      danD

      Looking at https://github.com/FusionAuth/fusionauth-java-client/blob/master/src/main/java/io/fusionauth/client/FusionAuthClient.java#L3256

      It appears there is no way to search using the Java client that uses a GET, only a POST. However, you can still provide the queryString in the JSON and it will be equivalent to the GET request.

      Building this JSON:

      { "search": { "queryString": "fusionauth.io" } }

      Is equivalent to queryString=fusionauth.io.

      Hope that helps.

    • danD

      Can I find all users by tenant?

      Q&A
      • tenant search users • • dan
      2
      0
      Votes
      2
      Posts
      1.6k
      Views

      danD

      Try clicking on the Advanced section on the User Search page and see you find what you're looking for.

      Or search like this tenantId:9d92ca33-bc7b-4d13-acd7-f7dc06038396 where 9d92ca33-bc7b-4d13-acd7-f7dc06038396 is your tenantId.

      Please note that this is an example for the elastic search search engine. With the database search engine, you can only search for the fields as documented in the API. As of this post, those are:

      firstName lastName fullName email username
    • danD

      Can you use the database search engine with millions of users?

      Q&A
      • search engine search user search database elasticsearch • • dan
      2
      1
      Votes
      2
      Posts
      5.1k
      Views

      danD

      I don't know of any issues. You’re mainly just giving up the ability to perform rich queries. The db search is a few LIKE statements.

      I don't think we've tested millions running db search - but the only issue I can think of for normal usage would be the User page in the UI since we’ll be paginating over lots of users.

      This should work ok - but pagination tends to slow way down as you get into higher pages,.

      One can always flip on Elastic and run an index, so not much harm in trying it.

    • danD

      Retrieving all users

      Q&A
      • users api search • • dan
      2
      0
      Votes
      2
      Posts
      2.0k
      Views

      danD

      From the user search docs, for the database search engine:

      Regular expressions may not be used. A value of * will match all records.

      For the elasticsearch search engine, you are limited to 10,000 records returned due to this bug: https://github.com/FusionAuth/fusionauth-issues/issues/494

      Here's docs on how to switch between them: https://fusionauth.io/docs/v1/tech/tutorials/switch-search-engines

    • danD

      Search for users by application

      Q&A
      • search user search application • • dan
      2
      0
      Votes
      2
      Posts
      1.3k
      Views

      danD

      You should be able to go the user's tab and then expand the 'advanced' section and select a given application.

      See this screenshot:

      user search with 'advanced' section expanded

    • danD

      Seeing "A request to the search index has failed. This error is unexpected" and I can no longer login with google

      Q&A
      • search login failure google • • dan
      2
      0
      Votes
      2
      Posts
      1.2k
      Views

      danD

      Hmmm. Since you haven't made any changes and aren't seeing any other errors, can you try to reindex?

      Navigate to system and then re-index in the administrative user interface?

      That should solve the issue.

    • danD

      Retrieving groups of users

      Q&A
      • groups search • • dan
      3
      0
      Votes
      3
      Posts
      1.2k
      Views

      danD

      Fix is live: https://github.com/FusionAuth/fusionauth-site/pull/147

    • danD

      Is there a way to get all the members of a particular group?

      Q&A
      • groups search • • dan
      2
      0
      Votes
      2
      Posts
      11.3k
      Views

      danD

      You need to use the user search API with an elastic search query string.

      Here's a curl example:

      API_KEY=.... GROUP_ID=f4a64b10-1cf6-4289-84c0-c3035f3b78bc curl -H "Authorization: $API_KEY" 'http://localhost:9011/api/user/search/?queryString=memberships.groupId:'$GROUP_ID

      If you are using the database search engine, you cannot find all the members of a group.

    • danD

      I'm having an issue with Elastic Search queries in FusionAuth.

      Q&A
      • elasticsearch elastic search • • dan
      2
      0
      Votes
      2
      Posts
      6.0k
      Views

      danD

      It depends on the issue, but there are two things you can do. Note that FusionAuth typically sends the query you post to the /api/user/search endpoint with the query parameter straight through to Elasticsearch

      First, ensure you are running elasticsearch and not the database search engine.

      Then, for some queries you can see the generate ElasticSearch query strings by clicking on the 'advanced' option in the user search area of the admin UI. This can be helpful.

      Finally, try running the query directly against elasticsearch and seeing if it works. Here are examples which will pull back all the data in your elasticsearch cluster (beware!).

      curl -XPOST -H 'Content-type: application/json' "http://localhost:9021/_search" -d' { "query": { "match_all": {} } }'

      or, if you have the query stored in query.json

      curl -XPOST -H 'Content-type: application/json' "http://localhost:9021/_search" -d@query.json
    • danD

      Solved What is the advantage of using ElasticSearch as the search engine?

      Q&A
      • elastic search user search • • dan
      4
      0
      Votes
      4
      Posts
      12.9k
      Views

      danD

      Here's a doc about how to switch search engines: https://fusionauth.io/docs/v1/tech/tutorials/switch-search-engines

    • danD

      Can I query a user on their user data?

      Q&A
      • user user-data search query faq • • dan
      4
      0
      Votes
      4
      Posts
      8.5k
      Views

      danD

      @le-nnyburkdoll

      This guide might be helpful to you: https://fusionauth.io/docs/v1/tech/guides/user-search-with-elasticsearch

      Thanks,
      Dan

    • danD

      Can we search on userId?

      Q&A
      • faq user search admin ui • • dan
      2
      0
      Votes
      2
      Posts
      5.6k
      Views

      danD

      You can search on the user id. While it doesn't say that in the placeholder, it works.

    • danD

      Is there an api to force a reindex of the users?

      Q&A
      • user search reindex • • dan
      3
      0
      Votes
      3
      Posts
      6.2k
      Views

      M

      Hello
      It depends on the specific system or platform you are using. You may need to consult its documentation or support resources.