Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

max query length allowed in elasticsearch

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.

like image 880
harsha Avatar asked Mar 13 '14 11:03

harsha


People also ask

Can I query large data sets with Elasticsearch?

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.

What is the difference between Elasticsearch and other search engines?

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.

What is _score in Elasticsearch?

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.

How to set the maximum terms count in a terms query?

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.


1 Answers

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

like image 71
crlane Avatar answered Oct 17 '22 12:10

crlane