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