Link Search Menu Expand Document Documentation Menu

This version of the OpenSearch documentation is no longer maintained. For the latest version, see the current documentation. For information about OpenSearch version maintenance, see Release Schedule and Maintenance Policy.

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:

GET shakespeare/_search
  "query": {
    "ids": {
      "values": [


The query accepts the following parameter.

Parameter Data type Description
values Array of strings The document IDs to search for. Required.
350 characters left

Have a question? .

Want to contribute? or .