Merge remaining sig_terms into terms#57397
Merged
nik9000 merged 7 commits intoelastic:masterfrom Jun 4, 2020
Merged
Conversation
Merges the remaining implementation of `significant_terms` into `terms` so that we can more easilly make them work properly without `asMultiBucketAggregator` which *should* save memory and speed them up. Relates elastic#56487
Member
Author
|
@elasticsearchmachine run elasticsearch-ci/default-distro |
Member
Author
|
run elasticsearch-ci/1 |
1 similar comment
Member
Author
|
run elasticsearch-ci/1 |
Collaborator
|
Pinging @elastic/es-analytics-geo (:Analytics/Aggregations) |
nik9000
commented
Jun 1, 2020
| spare.globalOrd = globalOrd; | ||
| spare.bucketOrd = bucketOrd; | ||
| spare.docCount = docCount; | ||
| otherDocCount += docCount; |
Member
Author
There was a problem hiding this comment.
This was causing inaccurate doc counts when shard_min_doc_count was more than 1.
| BucketOrdsEnum ordsEnum = bucketOrds.ordsEnum(owningBucketOrds[ordIdx]); | ||
| Supplier<B> emptyBucketBuilder = emptyBucketBuilder(owningBucketOrds[ordIdx]); | ||
| while (ordsEnum.next()) { | ||
| long docCount = bucketDocCount(ordsEnum.ord()); |
Member
Author
There was a problem hiding this comment.
I flip the if statement here and moved the spare initialization down to right before I need it to line up with the way the map version works.
| /** | ||
| * An aggregator of string values. | ||
| */ | ||
| public class StringTermsAggregator extends AbstractStringTermsAggregator { |
Member
Author
There was a problem hiding this comment.
Really just renamed this class to MapStringTermsAggregator but a lot changed.
16 tasks
not-napoleon
approved these changes
Jun 3, 2020
Member
not-napoleon
left a comment
There was a problem hiding this comment.
Looks good to me. Much easier to see the relationship between these two aggs now.
nik9000
added a commit
to nik9000/elasticsearch
that referenced
this pull request
Jun 4, 2020
Merges the remaining implementation of `significant_terms` into `terms` so that we can more easilly make them work properly without `asMultiBucketAggregator` which *should* save memory and speed them up. Relates elastic#56487
nik9000
added a commit
that referenced
this pull request
Jun 4, 2020
nik9000
added a commit
to nik9000/elasticsearch
that referenced
this pull request
Jun 4, 2020
nik9000
added a commit
that referenced
this pull request
Jun 4, 2020
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Merges the remaining implementation of
significant_termsintotermsso that we can more easilly make them work properly without
asMultiBucketAggregatorwhich should save memory and speed them up.Relates #56487