mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-06-28 17:34:17 -04:00
In a few previous PR's we restructured the ES|QL docs to make it possible to generate them dynamically. This PR just moves a few files around to make the query languages docs easier to work with, and a little more organized like the ES|QL docs. A bit part of this was setting up redirects to the new locations, so other repo's could correctly link to the elasticsearch docs.
1.6 KiB
1.6 KiB
Joining queries [joining-queries]
Performing full SQL-style joins in a distributed system like Elasticsearch is prohibitively expensive. Instead, Elasticsearch offers two forms of join which are designed to scale horizontally.
nested
query- Documents may contain fields of type
nested
. These fields are used to index arrays of objects, where each object can be queried (with thenested
query) as an independent document. has_child
andhas_parent
queries- A
join
field relationship can exist between documents within a single index. Thehas_child
query returns parent documents whose child documents match the specified query, while thehas_parent
query returns child documents whose parent document matches the specified query.
Also see the terms-lookup mechanism in the terms
query, which allows you to build a terms
query from values contained in another document.
Notes [joining-queries-notes]
Allow expensive queries [_allow_expensive_queries_2]
Joining queries will not be executed if search.allow_expensive_queries
is set to false.