FusionAuth
    • Home
    • Categories
    • Recent
    • Popular
    • Pricing
    • Contact us
    • Docs
    • Login

    Searching for users with the java client

    Scheduled Pinned Locked Moved
    Q&A
    java client search users
    0
    2
    5.4k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • danD
      dan
      last edited by

      Hello, with the Java client we are searching Users in FusionAuth that are in a specific Group, using the method client.searchUsersByQuery(). We currently use Elasticsearch as search engine, but it seems to be slow even with the local install (270 Groups, 500 Users in total). So we would like to compare performance to using the database search engine (PosgreSQL).

      Although this search request (Users in a Group) does not require a JSON request body but can be handled via URL parameters (queryString), the Java client still calls the user search API with a JSON request body.

      The docs state that advanced queries via a JSON request body are not possible with the database search engine. My question is if it is possible to use the Java client for user search without JSON request body, but only queryString as URL parameter? Since I could not find this in the docs or Java code, I am asking here.

      --
      FusionAuth - Auth for devs, built by devs.
      https://fusionauth.io

      1 Reply Last reply Reply Quote 0
      • danD
        dan
        last edited by

        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.

        --
        FusionAuth - Auth for devs, built by devs.
        https://fusionauth.io

        1 Reply Last reply Reply Quote 0
        • First post
          Last post