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
Not clear on the requirement
"Size" could mean:
- The number of documents in the index
- The number of documents that match the query
- The number of documents returned in the top-matching
- The number of documents analyzed in
- 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?
To avoid Memory issues
Note that from + size can not be more than the index.max_result_window index setting which defaults to 10,000.