When and How to Use INNERJOIN
Only use INNERJOIN
for complex multicriteria search on the right-side
document. In the above example, this is the customer
.
Ideally, for better search performance, aim instead to inline the right-side document
information in the left-side document. However, INNERJOIN
is mandatory for
certain multicriteria queries.
Requirements
-
The field must be an integer, a date or a value, retrievable and RAM-based.
-
For a value field, the
innerjoin
does not support two different join key fields for left and right side. For details about value fields, see Create Value Facets for Nonhierarchical Metas.
Perform an INNERJOIN Query
When the join field name is the same for both left and right documents
- UQL:
(left-side query) INNERJOIN/field (right-side query)
- ELLQL:
#innerjoin(field, left-side query, right-side query)
When the join field name is different for the left and right documents (not applicable to value fields)
- UQL:
(left-side query) INNERJOIN/field1=field2 right-side query)
- ELLQL:
#innerjoin(field1,field2, left-side query, right-side query)
Important: When using a join field that was generated by a Data Model property, always specify the full field name, prefixed by the declaring class name, even in UQL. |
Hide INNERJOIN from Users
To avoid exposing the INNERJOIN
operator to the user, you can use query
templates to combine ELLQL and UQL to perform the join from the user query. For details,
see Defining Query Templates.