ids-query.asciidoc 573 B

12345678910111213141516171819202122
  1. [[query-dsl-ids-query]]
  2. === Ids Query
  3. Filters documents that only have the provided ids. Note, this query
  4. uses the <<mapping-id-field,_id>> field.
  5. [source,js]
  6. --------------------------------------------------
  7. GET /_search
  8. {
  9. "query": {
  10. "ids" : {
  11. "type" : "_doc",
  12. "values" : ["1", "4", "100"]
  13. }
  14. }
  15. }
  16. --------------------------------------------------
  17. // CONSOLE
  18. The `type` is optional and can be omitted, and can also accept an array
  19. of values. If no type is specified, all types defined in the index mapping are tried.