2013-08-28 19:24:34 -04:00
|
|
|
[[query-dsl-ids-query]]
|
2015-06-03 19:59:22 -04:00
|
|
|
=== Ids Query
|
2013-08-28 19:24:34 -04:00
|
|
|
|
2015-05-05 02:27:52 -04:00
|
|
|
Filters documents that only have the provided ids. Note, this query
|
2018-04-11 03:41:37 -04:00
|
|
|
uses the <<mapping-id-field,_id>> field.
|
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" : {
|
2017-12-14 11:47:53 -05:00
|
|
|
"type" : "_doc",
|
2016-05-24 05:58:43 -04:00
|
|
|
"values" : ["1", "4", "100"]
|
|
|
|
}
|
2013-08-28 19:24:34 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
2016-05-24 05:58:43 -04:00
|
|
|
// CONSOLE
|
2013-08-28 19:24:34 -04:00
|
|
|
|
|
|
|
The `type` is optional and can be omitted, and can also accept an array
|
2015-04-30 18:01:35 -04:00
|
|
|
of values. If no type is specified, all types defined in the index mapping are tried.
|