2013-08-28 19:24:34 -04:00
|
|
|
[[query-dsl-ids-query]]
|
2019-07-18 10:18:11 -04:00
|
|
|
=== IDs
|
|
|
|
++++
|
|
|
|
<titleabbrev>IDs</titleabbrev>
|
|
|
|
++++
|
|
|
|
|
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
|
|
|
|
2019-09-09 12:35:50 -04:00
|
|
|
[source,console]
|
2013-08-28 19:24:34 -04:00
|
|
|
--------------------------------------------------
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
2019-04-10 14:35:24 -04:00
|
|
|
|
2019-04-30 10:19:09 -04:00
|
|
|
[[ids-query-top-level-parameters]]
|
2019-04-10 14:35:24 -04:00
|
|
|
==== Top-level parameters for `ids`
|
|
|
|
|
2019-05-09 09:51:12 -04:00
|
|
|
`values`::
|
2019-07-31 14:18:22 -04:00
|
|
|
(Required, array of strings) An array of <<mapping-id-field, document IDs>>.
|