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

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

    Scheduled Pinned Locked Moved
    General Discussion
    elasticsearch users api
    0
    2
    7.7k
    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.
    • joshuaJ
      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
      • joshuaJ
        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