2015-05-05 02:27:52 -04:00
|
|
|
[[query-dsl-limit-query]]
|
2015-06-03 19:59:22 -04:00
|
|
|
=== Limit Query
|
2013-08-28 19:24:34 -04:00
|
|
|
|
2015-04-10 11:38:12 -04:00
|
|
|
deprecated[1.6.0, Use <<search-request-body,terminate_after>> instead]
|
2015-04-10 09:41:56 -04:00
|
|
|
|
2015-05-05 02:27:52 -04:00
|
|
|
A limit query limits the number of documents (per shard) to execute on.
|
2013-08-28 19:24:34 -04:00
|
|
|
For example:
|
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
|
|
|
{
|
|
|
|
"filtered" : {
|
|
|
|
"filter" : {
|
|
|
|
"limit" : {"value" : 100}
|
|
|
|
},
|
|
|
|
"query" : {
|
|
|
|
"term" : { "name.first" : "shay" }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|