Joining queries
OpenSearch is a distributed system in which data is spread across multiple nodes. Thus, running a SQL-like JOIN operation in OpenSearch is resource intensive. As an alternative, OpenSearch provides the following queries that perform join operations and are optimized for scaling across multiple nodes:
- Queries for searching nested fields:
nested
queries: Act as wrappers for other queries to search nested fields. The nested field objects are searched as though they were indexed as separate documents.
- Queries for searching documents connected by a join field type, which establishes a parent/child relationship between documents in the same index:
- has_child queries: Search for parent documents whose child documents match the query.
- has_parent queries: Search for child documents whose parent documents match the query.
- parent_id queries: Search for child documents that are joined to a specific parent document.
If search.allow_expensive_queries is set to false
, then joining queries are not executed.
当前内容版权归 OpenSearch 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 OpenSearch .