forked from elastic/elasticsearch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix profiled global agg (backport of elastic#71575) (elastic#71634)
This fixes the `global` aggregator when `profile` is enabled. It does so by removing all of the special case handling for `global` aggs in `AggregationPhase` and having the global aggregator itself perform the scoped collection using the same trick that we use in filter-by-filter mode of the `filters` aggregation. Closes elastic#71098
- Loading branch information
Showing
10 changed files
with
166 additions
and
107 deletions.
There are no files selected for viewing
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
64 changes: 64 additions & 0 deletions
64
...-api-spec/src/yamlRestTest/resources/rest-api-spec/test/search.aggregation/380_global.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,64 @@ | ||
setup: | ||
- do: | ||
bulk: | ||
refresh: true | ||
index: test | ||
body: | ||
- '{"index": {}}' | ||
- '{"name": "one"}' | ||
- '{"index": {}}' | ||
- '{"name": "two"}' | ||
- '{"index": {}}' | ||
- '{"name": "two"}' | ||
|
||
--- | ||
simple: | ||
- do: | ||
search: | ||
index: test | ||
body: | ||
size: 0 | ||
query: | ||
match: | ||
name: two | ||
aggs: | ||
g: | ||
global: {} | ||
aggs: | ||
t: | ||
terms: | ||
field: name.keyword | ||
|
||
- match: { aggregations.g.doc_count: 3 } | ||
- length: { aggregations.g.t.buckets: 2 } | ||
- match: { aggregations.g.t.buckets.0.key: two } | ||
- match: { aggregations.g.t.buckets.1.key: one } | ||
|
||
--- | ||
profile: | ||
- skip: | ||
version: " - 7.99.99" | ||
reason: fixed in 8.0.0 (to be backported to 7.13.0) | ||
|
||
- do: | ||
search: | ||
index: test | ||
body: | ||
profile: true | ||
size: 0 | ||
query: | ||
match: | ||
name: two | ||
aggs: | ||
g: | ||
global: {} | ||
aggs: | ||
t: | ||
terms: | ||
field: name.keyword | ||
|
||
- match: { aggregations.g.doc_count: 3 } | ||
- length: { aggregations.g.t.buckets: 2 } | ||
- match: { aggregations.g.t.buckets.0.key: two } | ||
- match: { aggregations.g.t.buckets.1.key: one } | ||
- match: { profile.shards.0.aggregations.0.description: g } |
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
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
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
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
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
Oops, something went wrong.