IDs query

Use the ids query to search for documents with one or more specific document ID values in the _id field. For example, the following query requests documents with the IDs 34229 and 91296:

  1. GET shakespeare/_search
  2. {
  3. "query": {
  4. "ids": {
  5. "values": [
  6. 34229,
  7. 91296
  8. ]
  9. }
  10. }
  11. }

copy

Parameters

The query accepts the following parameter.

ParameterData typeDescription
valuesArray of stringsThe document IDs to search for. Required.
boostFloating-pointA floating-point value that specifies the weight of this field toward the relevance score. Values above 1.0 increase the field’s relevance. Values between 0.0 and 1.0 decrease the field’s relevance. Default is 1.0.