Skip to content

Conversation

@not-napoleon
Copy link
Member

This refactors searchAndReduce to use a parameter object, which removes a bunch of redundant overrides, and makes life much easier for adding new parameters in the future. I need that second part to add a parameter for testing caching over in #90114 so that the exactly two tests which are failing can tell the framework they don't actually expect to be cached.

Yaks--;

@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-analytics-geo (Team:Analytics)

Copy link
Member

@nik9000 nik9000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's much nicer!

MappedFieldType... fieldTypes) {
public AggTestConfig(IndexSearcher searcher, Query query, AggregationBuilder builder, MappedFieldType... fieldTypes) {
this(searcher, query, builder, DEFAULT_MAX_BUCKETS, randomBoolean(), fieldTypes);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if Query should default to MatchAllDocs. Otherwise, 👍

* @param splitLeavesIntoSeparateAggregators If true this creates a new {@link Aggregator}
* for each leaf as though it were a separate index. If false this aggregates
* all leaves together, like we do in production.
* @param aggTestConfig
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Zap this?

@not-napoleon
Copy link
Member Author

@elasticmachine update branch

@not-napoleon not-napoleon merged commit 15932d5 into elastic:main Sep 20, 2022
@not-napoleon not-napoleon deleted the refactor-aggregator-test-case branch September 20, 2022 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Analytics/Aggregations Aggregations >non-issue >refactoring Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) >tech debt v8.5.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants