Navigation

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

    How do I get more results than the default allowed by ElasticSearch?

    General Discussion
    elasticsearch users api
    0
    2
    793
    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.
    • joshua
      joshua last edited by

      How do I get more results than the default allowed by ElasticSearch? (10k, as of this question)?

      1 Reply Last reply Reply Quote 0
      • joshua
        joshua last edited by joshua

        You have a few options.

        Limit Query

        1. One option is to find a way to limit your search by logical increments. For example, if you are searching on users you may consider obtaining and appending results by first name in a loop.

        As an example:

        for (letter in [a...z]) {
            query + " AND user email starts with $letter"
            // do work
        }
        

        Use Version > 1.24.0 when pulling something like users

        https://fusionauth.io/docs/v1/tech/apis/users/#request-parameters-12

        Request Parameters
        accurateTotal [Boolean] OPTIONAL Defaults to false AVAILABLE SINCE 1.24.0
        Set this value equal to true to receive an accurate hit count on the API response.
        
        By default the search engine will limit the hit count to 10,000 users. This means that even if your query may match more than 10,000 users, the returned total count will be 10,000. This is adequate for many use cases such as pagination and general purpose queries. If you are looking for an accurate user count that can exceed 10,000 matches, you will want to set this value equal to true.
        
        1 Reply Last reply Reply Quote 0
        • First post
          Last post