Skip to content

Commit 140bb1f

Browse files
georgewallaceleemthompoalex-spies
authored
Apply suggestions from code review
Co-authored-by: Liam Thompson <[email protected]> Co-authored-by: Alexander Spies <[email protected]>
1 parent 74d627a commit 140bb1f

File tree

3 files changed

+19
-13
lines changed

3 files changed

+19
-13
lines changed

docs/reference/query-languages/esql/esql-commands.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,11 @@ FROM firewall_logs
677677

678678
**Parameters**
679679

680-
TBD
680+
`<lookup_index>`
681+
: The name of the lookup index. This must be a specific index name - wildcards, aliases, and remote cluster references are not supported.
682+
683+
`<field_name>`
684+
: The field to join on. This field must exist in both your current query results and in the lookup index. If the field contains multi-valued entries, those entries will not match anything (the added fields will contain `null` for those rows).
681685

682686
**Description**
683687

docs/reference/query-languages/esql/esql-enrich-data.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ For example, you can use `ENRICH` to:
2222
* You are working with structured enrichment patterns
2323
* You can accept having multiple matches combined into multi-values
2424
* You can accept being limited to predefined match fields
25-
* `ENRICH` has a simplified security model. There are no restirctions to specific enrich policies or document and field level security.
25+
* `ENRICH` has a simplified security model. There are no restrictions to specific enrich policies or document and field level security.
2626

2727
### How the `ENRICH` command works [esql-how-enrich-works]
2828

docs/reference/query-languages/esql/esql-lookup-join.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ mapped_pages:
44
- https://www.elastic.co/guide/en/elasticsearch/reference/current/esql-enrich-data.html
55
---
66

7-
# LOOKUP JOIN [esql-lookup-join]
7+
# LOOKUP JOIN [esql-lookup-join-reference]
88

9-
The {{esql}} [`LOOKUP join`](/reference/query-languages/esql/esql-commands.md#esql-lookup-join) processing command combines, at query-time, data from one or more source indexes with correlated information found in an input table. Teams often have data scattered across multiple indices – like logs, IPs, user IDs, hosts, employees etc. Without a direct way to enrich or correlate each event with reference data, root-cause analysis, security checks, and operational insights become time-consuming.
9+
The {{esql}} [`LOOKUP JOIN`](/reference/query-languages/esql/esql-commands.md#esql-lookup-join) processing command combines data from your {esql} query results table with matching records from a specified lookup index. It adds fields from the lookup index as new columns to your results table based on matching values in the join field.
10+
11+
Teams often have data scattered across multiple indices – like logs, IPs, user IDs, hosts, employees etc. Without a direct way to enrich or correlate each event with reference data, root-cause analysis, security checks, and operational insights become time-consuming.
1012

1113
For example, you can use `LOOKUP JOIN` to:
1214

@@ -16,11 +18,11 @@ For example, you can use `LOOKUP JOIN` to:
1618

1719
[`LOOKUP join`](/reference/query-languages/esql/esql-commands.md#esql-lookup-join) is similar to [`ENRICH`](/reference/query-languages/esql/esql-commands.md#esql-enrich) in the fact that they both help you join data together. You should use `LOOKUP JOIN` when:
1820

19-
* Enrichment data changes frequently
20-
* You want to avoid index time processing
21-
* Working with regular indices
22-
* Need to preserve distinct matches
23-
* Need to match on any field in a lookup index
21+
* Your enrichment data changes frequently
22+
* You want to avoid index-time processing
23+
* You're working with regular indices
24+
* You need to preserve distinct matches
25+
* You need to match on any field in a lookup index
2426
* You use document or field level security
2527

2628
## How the `LOOKUP JOIN` command works [esql-how-lookup-join-works]
@@ -40,7 +42,7 @@ Source index
4042

4143
In the case where there are multiple matches on the index `LOOKUP JOIN` the output rows is the combination of each match from the left with each match on the right.
4244

43-
Imagine you have the two tables:
45+
In this example, we have two sample tables:
4446

4547
**Left**
4648

@@ -84,7 +86,7 @@ FROM employees
8486

8587
::::
8688

87-
## Prerequisites [esql-enrich-prereqs]
89+
## Prerequisites [esql-lookup-join-prereqs]
8890

8991
To use `LOOKUP JOIN`, you must have:
9092

@@ -94,10 +96,10 @@ To use `LOOKUP JOIN`, you must have:
9496

9597
The following are the current limitations with `LOOKUP JOIN`
9698

97-
* `LOOKUP JOIN` will be sucessfull if both left and right type of the join are both `KEYWORD` types or if the left type is of `TEXT` and the right type is `KEYWORD`.
99+
* `LOOKUP JOIN` will be successful if the join field in the lookup index is a `KEYWORD` type. If the main index's join field is `TEXT` type, it must have an exact `.keyword` subfield that can be matched with the lookup index's `KEYWORD` field.
98100
* Indices in [lookup](/reference/elasticsearch/index-settings/index-modules.md#index-mode-setting) mode are always single-sharded.
99101
* Cross cluster search is unsupported. Both source and lookup indices must be local.
100-
* `LOOKUP JOIN` can only use a single match field, and can only use a single index. Wildcards, aliases, datemath, and datastreams are not supported.
102+
* `LOOKUP JOIN` can only use a single match field and a single index. Wildcards, aliases, datemath, and datastreams are not supported.
101103
* The name of the match field in `LOOKUP JOIN lu_idx ON match_field` must match an existing field in the query. This may require renames or evals to achieve.
102104
* The query will circuit break if many documents from the lookup index have the same key. A large heap is needed to manage results of multiple megabytes per key.
103105
* This limit is per page of data which is about about 10,000 rows.

0 commit comments

Comments
 (0)