Skip to content

Commit 20d6772

Browse files
Refactor Percentiles/Ranks aggregation builders and factories (#51887) (#54537)
- Consolidates HDR/TDigest factories into a single factory - Consolidates most HDR/TDigest builder into an abstract builder - Deprecates method(), compression(), numSigFig() in favor of a new unified PercentileConfig object - Disallows setting algo options that don't apply to current algo The unified config method carries both the method and algo-specific setting. This provides a mechanism to reject settings that apply to the wrong algorithm. For BWC the old methods are retained but marked as deprecated, and can be removed in future versions. Co-authored-by: Mark Tozzi <[email protected]> Co-authored-by: Mark Tozzi <[email protected]>
1 parent a5adac0 commit 20d6772

File tree

16 files changed

+810
-733
lines changed

16 files changed

+810
-733
lines changed

rest-api-spec/src/main/resources/rest-api-spec/test/search.aggregation/180_percentiles_tdigest_metric.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ setup:
262262
"Invalid params test":
263263

264264
- do:
265-
catch: /\[compression\] must be greater than or equal to 0. Found \[-1.0\] in \[percentiles_int\]/
265+
catch: /\[compression\] must be greater than or equal to 0. Found \[-1.0\]/
266266
search:
267267
rest_total_hits_as_int: true
268268
body:
@@ -274,7 +274,7 @@ setup:
274274
compression: -1
275275

276276
- do:
277-
catch: /\[percents\] must not be empty/
277+
catch: bad_request
278278
search:
279279
rest_total_hits_as_int: true
280280
body:

rest-api-spec/src/main/resources/rest-api-spec/test/search.aggregation/190_percentiles_hdr_metric.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ setup:
309309
number_of_significant_value_digits: null
310310

311311
- do:
312-
catch: /\[percents\] must not be empty/
312+
catch: bad_request
313313
search:
314314
rest_total_hits_as_int: true
315315
body:

server/src/main/java/org/elasticsearch/search/aggregations/metrics/AbstractPercentilesAggregationBuilder.java

Lines changed: 365 additions & 0 deletions
Large diffs are not rendered by default.

server/src/main/java/org/elasticsearch/search/aggregations/metrics/HDRPercentileRanksAggregatorFactory.java

Lines changed: 0 additions & 73 deletions
This file was deleted.

0 commit comments

Comments
 (0)