-
Notifications
You must be signed in to change notification settings - Fork 25k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
aggregator and yaml tests for missing agg (#53214)
Tests for unmapped fields, the missing parameter, scripting, and correct ValuesSource types in MissingAggregatorTests. Basic yaml tests for the missing agg For #42949
- Loading branch information
1 parent
9496369
commit 62a5246
Showing
2 changed files
with
507 additions
and
111 deletions.
There are no files selected for viewing
98 changes: 98 additions & 0 deletions
98
rest-api-spec/src/main/resources/rest-api-spec/test/search.aggregation/320_missing.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
setup: | ||
- do: | ||
indices.create: | ||
index: test | ||
body: | ||
settings: | ||
number_of_replicas: 0 | ||
mappings: | ||
properties: | ||
field1: | ||
type: long | ||
field2: | ||
type: long | ||
field3: | ||
type: long | ||
- do: | ||
bulk: | ||
refresh: true | ||
body: | ||
- index: | ||
_index: test | ||
- field1: 100 | ||
- index: | ||
_index: test | ||
- field1: 200 | ||
- index: | ||
_index: test | ||
- field1: 300 | ||
field2: 300 | ||
|
||
--- | ||
"match all": | ||
|
||
- do: | ||
search: | ||
rest_total_hits_as_int: true | ||
body: | ||
aggs: | ||
missing_agg: | ||
missing: | ||
field: field3 | ||
|
||
- match: { hits.total: 3 } | ||
- length: { hits.hits: 3 } | ||
|
||
- match: { aggregations.missing_agg.doc_count: 3 } | ||
|
||
--- | ||
"match some": | ||
|
||
- do: | ||
search: | ||
rest_total_hits_as_int: true | ||
body: | ||
aggs: | ||
missing_agg: | ||
missing: | ||
field: field2 | ||
|
||
- match: { hits.total: 3 } | ||
- length: { hits.hits: 3 } | ||
|
||
- match: { aggregations.missing_agg.doc_count: 2 } | ||
|
||
--- | ||
"match none": | ||
|
||
- do: | ||
search: | ||
rest_total_hits_as_int: true | ||
body: | ||
aggs: | ||
missing_agg: | ||
missing: | ||
field: field1 | ||
|
||
- match: { hits.total: 3 } | ||
- length: { hits.hits: 3 } | ||
|
||
- match: { aggregations.missing_agg.doc_count: 0 } | ||
|
||
--- | ||
"missing param": | ||
|
||
- do: | ||
search: | ||
rest_total_hits_as_int: true | ||
body: | ||
aggs: | ||
missing_agg: | ||
missing: | ||
field: field3 | ||
missing: 1 | ||
|
||
- match: { hits.total: 3 } | ||
- length: { hits.hits: 3 } | ||
|
||
- match: { aggregations.missing_agg.doc_count: 0 } |
Oops, something went wrong.