Navigation

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

      Searching for users with the java client
      Q&A • java client search users • • dan

      2
      0
      Votes
      2
      Posts
      3720
      Views

      dan

      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.

    • dan

      Can I find all users by tenant?
      Q&A • tenant search users • • dan

      2
      0
      Votes
      2
      Posts
      212
      Views

      dan

      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
    • dan

      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
      156
      Views

      dan

      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.

    • dan

      Retrieving all users
      Q&A • users api search • • dan

      2
      0
      Votes
      2
      Posts
      388
      Views

      dan

      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

    • dan

      Search for users by application
      Q&A • search user search application • • dan

      2
      0
      Votes
      2
      Posts
      133
      Views

      dan

      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

    • dan

      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
      195
      Views

      dan

      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.

    • dan

      Retrieving groups of users
      Q&A • groups search • • dan

      3
      0
      Votes
      3
      Posts
      239
      Views

      dan

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

    • dan

      Is there a way to get all the members of a particular group?
      Q&A • groups search • • dan

      2
      0
      Votes
      2
      Posts
      3631
      Views

      dan

      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.

    • dan

      I'm having an issue with Elastic Search queries in FusionAuth.
      Q&A • elasticsearch elastic search • • dan

      2
      0
      Votes
      2
      Posts
      254
      Views

      dan

      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
    • dan

      SOLVED What is the advantage of using ElasticSearch as the search engine?
      Q&A • elastic search user search • • dan

      4
      0
      Votes
      4
      Posts
      5888
      Views

      dan

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

    • dan

      Can I query a user on their user data?
      Q&A • user user-data search query faq • • dan

      2
      0
      Votes
      2
      Posts
      331
      Views

      dan

      You can experiment in the admin UI using the search field.

      You can use the query string DSL or a full JSON query in the search field, if you are running elastic search.

      Here's a link to building an ElasticSearch query (in version 6.3): https://www.elastic.co/guide/en/elasticsearch/reference/6.3/query-dsl-query-string-query.html

      For example if you have companyName in custom data, the query string would be data.companyName:"Acme Corp."

      If you are using the database search, you won't be able to use this kind of querying.

      Here's more on the difference between the database search and elasticsearch options for user search: https://fusionauth.io/docs/v1/tech/core-concepts/users#user-search

    • dan

      Can we search on userId?
      Q&A • faq user search admin ui • • dan

      2
      0
      Votes
      2
      Posts
      176
      Views

      dan

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

    • dan

      Is there an api to force a reindex of the users?
      Q&A • user search reindex • • dan

      2
      0
      Votes
      2
      Posts
      232
      Views

      dan

      No, but you can flush the index: https://fusionauth.io/docs/v1/tech/apis/users#flush-the-search-engine . From that doc:

      This will cause any cached data to be written to disk.