indices-query.asciidoc 774 B

12345678910111213141516171819202122232425
  1. [[query-dsl-indices-query]]
  2. === Indices Query
  3. The `indices` query can be used when executed across multiple indices,
  4. allowing to have a query that executes only when executed on an index
  5. that matches a specific list of indices, and another query that executes
  6. when it is executed on an index that does not match the listed indices.
  7. [source,js]
  8. --------------------------------------------------
  9. {
  10. "indices" : {
  11. "indices" : ["index1", "index2"],
  12. "query" : {
  13. "term" : { "tag" : "wow" }
  14. },
  15. "no_match_query" : {
  16. "term" : { "tag" : "kow" }
  17. }
  18. }
  19. }
  20. --------------------------------------------------
  21. `no_match_query` can also have "string" value of `none` (to match no
  22. documents), and `all` (to match all).