2013-08-28 19:24:34 -04:00
|
|
|
[[query-dsl-ids-query]]
|
2015-06-03 19:59:22 -04:00
|
|
|
=== Ids Query
|
2019-04-10 14:35:24 -04:00
|
|
|
Returns documents based on their IDs. This query uses document IDs stored in
|
|
|
|
the <<mapping-id-field,`_id`>> field.
|
2013-08-28 19:24:34 -04:00
|
|
|
|
2019-04-10 14:35:24 -04:00
|
|
|
==== Example request
|
2013-08-28 19:24:34 -04:00
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
2016-05-24 05:58:43 -04:00
|
|
|
GET /_search
|
2013-08-28 19:24:34 -04:00
|
|
|
{
|
2016-05-24 05:58:43 -04:00
|
|
|
"query": {
|
|
|
|
"ids" : {
|
|
|
|
"values" : ["1", "4", "100"]
|
|
|
|
}
|
2013-08-28 19:24:34 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
2016-05-24 05:58:43 -04:00
|
|
|
// CONSOLE
|
2019-04-10 14:35:24 -04:00
|
|
|
|
|
|
|
==== Top-level parameters for `ids`
|
|
|
|
|
|
|
|
[cols="v,v",options="header"]
|
|
|
|
|======
|
|
|
|
|Parameter |Description
|
|
|
|
|`values` |An array of <<mapping-id-field, document IDs>>.
|
|
|
|
|======
|