Skip to content

Commit

Permalink
Add tests for query/agg on lookup runtime fields (#88389)
Browse files Browse the repository at this point in the history
Adds tests to ensure that querying and aggregating on lookup runtimes
aren't supported.

Relates #88296
  • Loading branch information
dnhatn authored Jul 8, 2022
1 parent d6b38f6 commit 227d809
Showing 1 changed file with 38 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,41 @@ setup:
- match: { hits.hits.0.fields.location: [ { country: [ 'Canada' ], city: [ 'Montreal' ] } ] }
- match: { hits.hits.1.fields.msg: [ 'The second message' ] }
- match: { hits.hits.1.fields.location: null }

---
"Fails to query or aggregate on lookup fields":
- skip:
version: " - 8.1.99"
reason: "Lookup fields are introduced in 8.2"
- do:
catch: /Field \[location\] of type \[lookup\] does not support match queries/
search:
index: logs
body:
runtime_mappings:
location:
type: lookup
target_index: ip_locations
input_field: ip
target_field: _id
fetch_fields: [ "city"]
query:
match:
location: montreal

- do:
catch: /Fielddata is not supported on field \[location\] of type \[lookup\]/
search:
index: logs
body:
runtime_mappings:
location:
type: lookup
target_index: ip_locations
input_field: ip
target_field: _id
fetch_fields: [ "city" ]
aggs:
locations:
terms:
field: location

0 comments on commit 227d809

Please sign in to comment.