How to increase query results limit of 10,000 results per search in AppSearch

AppSearch has a limit of max 10,000 search results per query.
Is this value configurable?

We have a requirement where we need to parse through all the search results for a particular filter condition, and update the resulting documents.
However if we don't get the right number of results(which can be more than 10,000), we would not be able to update those documents to the right value, this could lead to data in
-consistency.

Is there a way to get more than 10,000 results from a search query?

2 Likes

Heya @Subhasis_Dash! Unfortunately the 10k results per query limit isn't configurable (per Limits | Elastic App Search Documentation [7.14] | Elastic).

Unfortunately our APIs not having an easy way to return total # of documents is a known issue, but we have a 2 workarounds/approaches you could try if all you need is the >10k number of results.

The workarounds use the facets feature and depends on the structure/content of your documents. The idea is to use a criteria (either value or range facet) that is broad enough so that it will cover the entire set of your documents.

Option 1 (using value facet):

  • Add a new field to every document you have and set it to the same/exact field value
  • Then add the value facet clause against this new field to every search request. Given that every document will be tagged with this same/exact value, you can use the count returned for this value facet (since every document will be tagged with the same field value)

Option 2 (using range facet):

  • If you have an existing "date" field (e.g., created_at, updated_at, etc..) that is already there in every document, you can use a range facet clause against this "date" field and set the range be as broad as possible that will cover every document, e.g., set the range facet with a range from a really ancient date 1900-01-01T12:00:00.000Z to today's date (or a future date) to ensure that it covers every single document
  • Then add the range facet clause against this existing "date" field to every search request. Since every document will be covered in this range, you can use the count returned from this range facet

Hope that helped, and I'll definitely reflag this issue to our team as something to look at in our APIs!

3 Likes

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.