App Search Filter Array limitation

I need to query App Search only for selected documents. I am aware of search API filter options Search API filters and hence I am using filters, say id. The challenge here is: App Search has a limitation of 1024 values in each array. So, at max I can search across 1024 documents only (1024 document ids passed in filter). Is there any way if I can query against more number of documents, say 7k?

1 Like

@SriAkash you've mentioned the maximum number of filterable items, which is a hard limit at the moment and I don't believe there are any plans at the moment to make this a configurable limit.

Are there any attributes that these documents share in common? If you were able to update your documents to categorize them, you could filter on a new field. You would also be able to remove that field from the list of fields in the resulting documents if you did not want it returned.

In hopes of providing a more helpful reason for these limits, the Elasticsearch documentation explains:

This setting limits the number of clauses a Lucene BooleanQuery can have. The default of 1024 is quite high and should normally be sufficient. This limit does not only affect Elasticsearchs bool query, but many other queries are rewritten to Lucene’s BooleanQuery internally. The limit is in place to prevent searches from becoming too large and taking up too much CPU and memory. In case you’re considering increasing this setting, make sure you’ve exhausted all other options to avoid having to do this. Higher values can lead to performance degradations and memory issues, especially in clusters with a high load or few resources.

I hope this is helpful!

Brian

This is really helpful