Limit the query size in elasticsearch


(justin) #1

How can I limit the query to be executed (I mean the size) If the size is ,more size for example 10M than automatically the query has to be withdrawn/throw message


(Mark Harwood) #2

Not clear on the requirement
"Size" could mean:

  1. The number of documents in the index
  2. The number of documents that match the query
  3. The number of documents returned in the top-matching hits
  4. The number of documents analyzed in aggregations
  5. The number of terms in an aggregation e.g. top N authors.

What problem are you trying to avoid? Long-running queries? Irrelevant results? Memory issues?


(justin) #3

Hi

To avoid Memory issues

Regards

Justin


(David Pilato) #4

Look at https://www.elastic.co/guide/en/elasticsearch/reference/2.1/search-request-from-size.html

Note that from + size can not be more than the index.max_result_window index setting which defaults to 10,000.


(system) #5