|
@@ -19,17 +19,22 @@ FROM <source_index>
|
|
|
FROM <source_index>
|
|
|
| LOOKUP JOIN <lookup_index> ON <field_name1>, <field_name2>, <field_name3>
|
|
|
```
|
|
|
+```esql
|
|
|
+FROM <source_index>
|
|
|
+| LOOKUP JOIN <lookup_index> ON <left_field1> >= <lookup_field1> AND <left_field2> == <lookup_field2>
|
|
|
+```
|
|
|
|
|
|
**Parameters**
|
|
|
|
|
|
`<lookup_index>`
|
|
|
: The name of the lookup index. This must be a specific index name - wildcards, aliases, and remote cluster references are not supported. Indices used for lookups must be configured with the [`lookup` index mode](/reference/elasticsearch/index-settings/index-modules.md#index-mode-setting).
|
|
|
|
|
|
-`<field_name>` or `<field_name1>, <field_name2>, <field_name3>`
|
|
|
-: The field(s) to join on. Can be either:
|
|
|
- * A single field name
|
|
|
- * A comma-separated list of field names {applies_to}`stack: ga 9.2`
|
|
|
-: These fields must exist in both your current query results and in the lookup index. If the fields contains multi-valued entries, those entries will not match anything (the added fields will contain `null` for those rows).
|
|
|
+`<field_name>` or `<field_name1>, <field_name2>, <field_name3>` or `<left_field1> >= <lookup_field1> AND <left_field2> == <lookup_field2>`
|
|
|
+: The join condition. Can be one of the following:
|
|
|
+ * A single field name
|
|
|
+ * A comma-separated list of field names {applies_to}`stack: ga 9.2`
|
|
|
+ * An expression with one or more join conditions linked by `AND`. Each condition compares a field from the left index with a field from the lookup index using [binary operators](/reference/query-languages/esql/functions-operators/operators.md#esql-binary-operators) (`==`, `>=`, `<=`, `>`, `<`, `!=`). Each field name in the join condition must exist in only one of the indexes. Use RENAME to resolve naming conflicts. {applies_to}`stack: preview 9.2` {applies_to}`serverless: preview`
|
|
|
+: If using join on a single field or a field list, the fields used must exist in both your current query results and in the lookup index. If the fields contains multi-valued entries, those entries will not match anything (the added fields will contain `null` for those rows).
|
|
|
|
|
|
|
|
|
**Description**
|