Skip to content

Commit

Permalink
Add new multi_term aggregation (#2687)
Browse files Browse the repository at this point in the history
Adds a new multi_term aggregation. The current implementation focuses 
on adding new type aggregates. Performance (latency) is suboptimal in this
iteration, mainly because of brute force encoding/decoding a list of values
into bucket keys. A performance improvement change will be made as a 
follow on.

Signed-off-by: Peng Huo <penghuo@gmail.com>
  • Loading branch information
penghuo authored Apr 21, 2022
1 parent 6517eec commit 03fbca3
Show file tree
Hide file tree
Showing 23 changed files with 4,378 additions and 407 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,9 @@
import org.opensearch.search.aggregations.bucket.sampler.InternalSampler;
import org.opensearch.search.aggregations.bucket.sampler.ParsedSampler;
import org.opensearch.search.aggregations.bucket.terms.LongRareTerms;
import org.opensearch.search.aggregations.bucket.terms.MultiTermsAggregationBuilder;
import org.opensearch.search.aggregations.bucket.terms.ParsedLongRareTerms;
import org.opensearch.search.aggregations.bucket.terms.ParsedMultiTerms;
import org.opensearch.search.aggregations.bucket.terms.ParsedSignificantLongTerms;
import org.opensearch.search.aggregations.bucket.terms.ParsedSignificantStringTerms;
import org.opensearch.search.aggregations.bucket.terms.ParsedStringRareTerms;
Expand Down Expand Up @@ -2140,6 +2142,7 @@ static List<NamedXContentRegistry.Entry> getDefaultNamedXContents() {
map.put(IpRangeAggregationBuilder.NAME, (p, c) -> ParsedBinaryRange.fromXContent(p, (String) c));
map.put(TopHitsAggregationBuilder.NAME, (p, c) -> ParsedTopHits.fromXContent(p, (String) c));
map.put(CompositeAggregationBuilder.NAME, (p, c) -> ParsedComposite.fromXContent(p, (String) c));
map.put(MultiTermsAggregationBuilder.NAME, (p, c) -> ParsedMultiTerms.fromXContent(p, (String) c));
List<NamedXContentRegistry.Entry> entries = map.entrySet()
.stream()
.map(entry -> new NamedXContentRegistry.Entry(Aggregation.class, new ParseField(entry.getKey()), entry.getValue()))
Expand Down
Loading

0 comments on commit 03fbca3

Please sign in to comment.