I need to send a large bunch of ids in terms query, and i tried with approx 2000 guids, but I found that the data is not being posted to elasticseach. Json array was empty. Is there any limit to max count of values in terms query??and is there any config setting that can increase the max query length for terms query.
I just tried to find out on web if its the json_encode function that does not support such a large array size to encode, but its not the case, so second thing that came to my mind is if elasticsearch terms query supports this or not??
Any help or guidance will be highly appreciated.
The Scan and the Scroll API aren’t for real-time queries, but for indexing large amounts of data into a newly comprised index. Keeping that in mind, it’s still very good to know that with Elasticsearch, you can query large data sets using the correct code.
The difference between it and the others is that Elasticsearch s flexible enough to retrieve large quantities–not just a single page of search results. In addition, the powerful scroll API can return all of the availalbe results when you query a large data set just one time.
When you provide Elasticsearch a query it will not only filter out any documents that do not match the query, but assign each document a score which signifies how well the document matched the query, this score is added to the _score field of the returned documents.
This maximum can be set by changing the [index.max_terms_count] index level setting. this explains why we were able to run a terms query with 999 999 terms. If one runs the first example against a ES 6.2 one can see there is no error and the query returns as expected.
If you are using a bool filter or query, it looks like there is a limit of 1024 clauses. See this.
https://groups.google.com/forum/#!topic/elasticsearch/LqywKHKWbeI
Based on that same link, it also appears that you can the option in your elasticsearch.yml
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With