joining-queries.asciidoc 987 B

12345678910111213141516171819202122232425262728
  1. [[java-joining-queries]]
  2. === Joining queries
  3. Performing full SQL-style joins in a distributed system like Elasticsearch is
  4. prohibitively expensive. Instead, Elasticsearch offers two forms of join
  5. which are designed to scale horizontally.
  6. <<java-query-dsl-nested-query,`nested` query>>::
  7. Documents may contains fields of type `nested`. These
  8. fields are used to index arrays of objects, where each object can be queried
  9. (with the `nested` query) as an independent document.
  10. <<java-query-dsl-has-child-query,`has_child`>> and <<java-query-dsl-has-parent-query,`has_parent`>> queries::
  11. A parent-child relationship can exist between two
  12. document types within a single index. The `has_child` query returns parent
  13. documents whose child documents match the specified query, while the
  14. `has_parent` query returns child documents whose parent document matches the
  15. specified query.
  16. include::nested-query.asciidoc[]
  17. include::has-child-query.asciidoc[]
  18. include::has-parent-query.asciidoc[]