Search in sources :

Example 1 with FiltersAggregationBuilder

use of org.elasticsearch.search.aggregations.bucket.filters.FiltersAggregationBuilder in project elasticsearch by elastic.

the class FiltersAggsRewriteIT method testWrapperQueryIsRewritten.

public void testWrapperQueryIsRewritten() throws IOException {
    createIndex("test", Settings.EMPTY, "test", "title", "type=text");
    client().prepareIndex("test", "test", "1").setSource("title", "foo bar baz").get();
    client().prepareIndex("test", "test", "2").setSource("title", "foo foo foo").get();
    client().prepareIndex("test", "test", "3").setSource("title", "bar baz bax").get();
    client().admin().indices().prepareRefresh("test").get();
    XContentType xContentType = randomFrom(XContentType.values());
    BytesReference bytesReference;
    try (XContentBuilder builder = XContentFactory.contentBuilder(xContentType)) {
        builder.startObject();
        {
            builder.startObject("terms");
            {
                builder.array("title", "foo");
            }
            builder.endObject();
        }
        builder.endObject();
        bytesReference = builder.bytes();
    }
    FiltersAggregationBuilder builder = new FiltersAggregationBuilder("titles", new FiltersAggregator.KeyedFilter("titleterms", new WrapperQueryBuilder(bytesReference)));
    SearchResponse searchResponse = client().prepareSearch("test").setSize(0).addAggregation(builder).get();
    assertEquals(3, searchResponse.getHits().getTotalHits());
    InternalFilters filters = searchResponse.getAggregations().get("titles");
    assertEquals(1, filters.getBuckets().size());
    assertEquals(2, filters.getBuckets().get(0).getDocCount());
}
Also used : BytesReference(org.elasticsearch.common.bytes.BytesReference) InternalFilters(org.elasticsearch.search.aggregations.bucket.filters.InternalFilters) XContentType(org.elasticsearch.common.xcontent.XContentType) FiltersAggregator(org.elasticsearch.search.aggregations.bucket.filters.FiltersAggregator) FiltersAggregationBuilder(org.elasticsearch.search.aggregations.bucket.filters.FiltersAggregationBuilder) WrapperQueryBuilder(org.elasticsearch.index.query.WrapperQueryBuilder) XContentBuilder(org.elasticsearch.common.xcontent.XContentBuilder) SearchResponse(org.elasticsearch.action.search.SearchResponse)

Example 2 with FiltersAggregationBuilder

use of org.elasticsearch.search.aggregations.bucket.filters.FiltersAggregationBuilder in project elasticsearch by elastic.

the class FiltersAggregatorTests method testKeyedFilter.

public void testKeyedFilter() throws Exception {
    Directory directory = newDirectory();
    RandomIndexWriter indexWriter = new RandomIndexWriter(random(), directory);
    Document document = new Document();
    document.add(new Field("field", "foo", fieldType));
    indexWriter.addDocument(document);
    document.clear();
    document.add(new Field("field", "else", fieldType));
    indexWriter.addDocument(document);
    // make sure we have more than one segment to test the merge
    indexWriter.commit();
    document.add(new Field("field", "foo", fieldType));
    indexWriter.addDocument(document);
    document.clear();
    document.add(new Field("field", "bar", fieldType));
    indexWriter.addDocument(document);
    document.clear();
    document.add(new Field("field", "foobar", fieldType));
    indexWriter.addDocument(document);
    indexWriter.commit();
    document.clear();
    document.add(new Field("field", "something", fieldType));
    indexWriter.addDocument(document);
    indexWriter.commit();
    document.clear();
    document.add(new Field("field", "foobar", fieldType));
    indexWriter.addDocument(document);
    indexWriter.close();
    IndexReader indexReader = DirectoryReader.open(directory);
    IndexSearcher indexSearcher = newSearcher(indexReader, true, true);
    FiltersAggregator.KeyedFilter[] keys = new FiltersAggregator.KeyedFilter[6];
    keys[0] = new FiltersAggregator.KeyedFilter("foobar", QueryBuilders.termQuery("field", "foobar"));
    keys[1] = new FiltersAggregator.KeyedFilter("bar", QueryBuilders.termQuery("field", "bar"));
    keys[2] = new FiltersAggregator.KeyedFilter("foo", QueryBuilders.termQuery("field", "foo"));
    keys[3] = new FiltersAggregator.KeyedFilter("foo2", QueryBuilders.termQuery("field", "foo"));
    keys[4] = new FiltersAggregator.KeyedFilter("same", QueryBuilders.termQuery("field", "foo"));
    // filter name already present so it should be merge with the previous one ?
    keys[5] = new FiltersAggregator.KeyedFilter("same", QueryBuilders.termQuery("field", "bar"));
    FiltersAggregationBuilder builder = new FiltersAggregationBuilder("test", keys);
    builder.otherBucket(true);
    builder.otherBucketKey("other");
    for (boolean doReduce : new boolean[] { true, false }) {
        final InternalFilters filters;
        if (doReduce) {
            filters = searchAndReduce(indexSearcher, new MatchAllDocsQuery(), builder, fieldType);
        } else {
            filters = search(indexSearcher, new MatchAllDocsQuery(), builder, fieldType);
        }
        assertEquals(filters.getBuckets().size(), 7);
        assertEquals(filters.getBucketByKey("foobar").getDocCount(), 2);
        assertEquals(filters.getBucketByKey("foo").getDocCount(), 2);
        assertEquals(filters.getBucketByKey("foo2").getDocCount(), 2);
        assertEquals(filters.getBucketByKey("bar").getDocCount(), 1);
        assertEquals(filters.getBucketByKey("same").getDocCount(), 1);
        assertEquals(filters.getBucketByKey("other").getDocCount(), 2);
    }
    indexReader.close();
    directory.close();
}
Also used : IndexSearcher(org.apache.lucene.search.IndexSearcher) FiltersAggregator(org.elasticsearch.search.aggregations.bucket.filters.FiltersAggregator) Document(org.apache.lucene.document.Document) MatchAllDocsQuery(org.apache.lucene.search.MatchAllDocsQuery) Field(org.apache.lucene.document.Field) InternalFilters(org.elasticsearch.search.aggregations.bucket.filters.InternalFilters) IndexReader(org.apache.lucene.index.IndexReader) FiltersAggregationBuilder(org.elasticsearch.search.aggregations.bucket.filters.FiltersAggregationBuilder) RandomIndexWriter(org.apache.lucene.index.RandomIndexWriter) Directory(org.apache.lucene.store.Directory)

Example 3 with FiltersAggregationBuilder

use of org.elasticsearch.search.aggregations.bucket.filters.FiltersAggregationBuilder in project elasticsearch by elastic.

the class FiltersAggregatorTests method testRandom.

public void testRandom() throws Exception {
    Directory directory = newDirectory();
    RandomIndexWriter indexWriter = new RandomIndexWriter(random(), directory);
    int numDocs = randomIntBetween(100, 200);
    int maxTerm = randomIntBetween(10, 50);
    int[] expectedBucketCount = new int[maxTerm];
    Document document = new Document();
    for (int i = 0; i < numDocs; i++) {
        if (frequently()) {
            // make sure we have more than one segment to test the merge
            indexWriter.commit();
        }
        int value = randomInt(maxTerm - 1);
        expectedBucketCount[value] += 1;
        document.add(new Field("field", Integer.toString(value), fieldType));
        indexWriter.addDocument(document);
        document.clear();
    }
    indexWriter.close();
    IndexReader indexReader = DirectoryReader.open(directory);
    IndexSearcher indexSearcher = newSearcher(indexReader, true, true);
    int numFilters = randomIntBetween(1, 10);
    QueryBuilder[] filters = new QueryBuilder[numFilters];
    int[] filterTerms = new int[numFilters];
    int expectedOtherCount = numDocs;
    Set<Integer> filterSet = new HashSet<>();
    for (int i = 0; i < filters.length; i++) {
        int value = randomInt(maxTerm - 1);
        filters[i] = QueryBuilders.termQuery("field", Integer.toString(value));
        filterTerms[i] = value;
        if (filterSet.contains(value) == false) {
            expectedOtherCount -= expectedBucketCount[value];
            filterSet.add(value);
        }
    }
    FiltersAggregationBuilder builder = new FiltersAggregationBuilder("test", filters);
    builder.otherBucket(true);
    builder.otherBucketKey("other");
    for (boolean doReduce : new boolean[] { true, false }) {
        final InternalFilters response;
        if (doReduce) {
            response = searchAndReduce(indexSearcher, new MatchAllDocsQuery(), builder, fieldType);
        } else {
            response = search(indexSearcher, new MatchAllDocsQuery(), builder, fieldType);
        }
        List<InternalFilters.InternalBucket> buckets = response.getBuckets();
        assertEquals(buckets.size(), filters.length + 1);
        for (InternalFilters.InternalBucket bucket : buckets) {
            if ("other".equals(bucket.getKey())) {
                assertEquals(bucket.getDocCount(), expectedOtherCount);
            } else {
                int index = Integer.parseInt(bucket.getKey());
                assertEquals(bucket.getDocCount(), (long) expectedBucketCount[filterTerms[index]]);
            }
        }
    }
    indexReader.close();
    directory.close();
}
Also used : IndexSearcher(org.apache.lucene.search.IndexSearcher) QueryBuilder(org.elasticsearch.index.query.QueryBuilder) Document(org.apache.lucene.document.Document) MatchAllDocsQuery(org.apache.lucene.search.MatchAllDocsQuery) Field(org.apache.lucene.document.Field) InternalFilters(org.elasticsearch.search.aggregations.bucket.filters.InternalFilters) IndexReader(org.apache.lucene.index.IndexReader) FiltersAggregationBuilder(org.elasticsearch.search.aggregations.bucket.filters.FiltersAggregationBuilder) RandomIndexWriter(org.apache.lucene.index.RandomIndexWriter) Directory(org.apache.lucene.store.Directory) HashSet(java.util.HashSet)

Example 4 with FiltersAggregationBuilder

use of org.elasticsearch.search.aggregations.bucket.filters.FiltersAggregationBuilder in project elasticsearch by elastic.

the class FiltersTests method testOtherBucket.

public void testOtherBucket() throws IOException {
    XContentBuilder builder = XContentFactory.contentBuilder(randomFrom(XContentType.values()));
    builder.startObject();
    builder.startArray("filters").endArray();
    builder.endObject();
    XContentParser parser = createParser(shuffleXContent(builder));
    parser.nextToken();
    QueryParseContext context = new QueryParseContext(parser);
    FiltersAggregationBuilder filters = FiltersAggregationBuilder.parse("agg_name", context);
    // The other bucket is disabled by default
    assertFalse(filters.otherBucket());
    builder = XContentFactory.contentBuilder(randomFrom(XContentType.values()));
    builder.startObject();
    builder.startArray("filters").endArray();
    builder.field("other_bucket_key", "some_key");
    builder.endObject();
    parser = createParser(shuffleXContent(builder));
    parser.nextToken();
    context = new QueryParseContext(parser);
    filters = FiltersAggregationBuilder.parse("agg_name", context);
    // but setting a key enables it automatically
    assertTrue(filters.otherBucket());
    builder = XContentFactory.contentBuilder(randomFrom(XContentType.values()));
    builder.startObject();
    builder.startArray("filters").endArray();
    builder.field("other_bucket", false);
    builder.field("other_bucket_key", "some_key");
    builder.endObject();
    parser = createParser(shuffleXContent(builder));
    parser.nextToken();
    context = new QueryParseContext(parser);
    filters = FiltersAggregationBuilder.parse("agg_name", context);
    // unless the other bucket is explicitly disabled
    assertFalse(filters.otherBucket());
}
Also used : QueryParseContext(org.elasticsearch.index.query.QueryParseContext) FiltersAggregationBuilder(org.elasticsearch.search.aggregations.bucket.filters.FiltersAggregationBuilder) XContentBuilder(org.elasticsearch.common.xcontent.XContentBuilder) XContentParser(org.elasticsearch.common.xcontent.XContentParser)

Example 5 with FiltersAggregationBuilder

use of org.elasticsearch.search.aggregations.bucket.filters.FiltersAggregationBuilder in project elasticsearch by elastic.

the class SearchModule method registerAggregations.

private void registerAggregations(List<SearchPlugin> plugins) {
    registerAggregation(new AggregationSpec(AvgAggregationBuilder.NAME, AvgAggregationBuilder::new, AvgAggregationBuilder::parse).addResultReader(InternalAvg::new));
    registerAggregation(new AggregationSpec(SumAggregationBuilder.NAME, SumAggregationBuilder::new, SumAggregationBuilder::parse).addResultReader(InternalSum::new));
    registerAggregation(new AggregationSpec(MinAggregationBuilder.NAME, MinAggregationBuilder::new, MinAggregationBuilder::parse).addResultReader(InternalMin::new));
    registerAggregation(new AggregationSpec(MaxAggregationBuilder.NAME, MaxAggregationBuilder::new, MaxAggregationBuilder::parse).addResultReader(InternalMax::new));
    registerAggregation(new AggregationSpec(StatsAggregationBuilder.NAME, StatsAggregationBuilder::new, StatsAggregationBuilder::parse).addResultReader(InternalStats::new));
    registerAggregation(new AggregationSpec(ExtendedStatsAggregationBuilder.NAME, ExtendedStatsAggregationBuilder::new, ExtendedStatsAggregationBuilder::parse).addResultReader(InternalExtendedStats::new));
    registerAggregation(new AggregationSpec(ValueCountAggregationBuilder.NAME, ValueCountAggregationBuilder::new, ValueCountAggregationBuilder::parse).addResultReader(InternalValueCount::new));
    registerAggregation(new AggregationSpec(PercentilesAggregationBuilder.NAME, PercentilesAggregationBuilder::new, PercentilesAggregationBuilder::parse).addResultReader(InternalTDigestPercentiles.NAME, InternalTDigestPercentiles::new).addResultReader(InternalHDRPercentiles.NAME, InternalHDRPercentiles::new));
    registerAggregation(new AggregationSpec(PercentileRanksAggregationBuilder.NAME, PercentileRanksAggregationBuilder::new, PercentileRanksAggregationBuilder::parse).addResultReader(InternalTDigestPercentileRanks.NAME, InternalTDigestPercentileRanks::new).addResultReader(InternalHDRPercentileRanks.NAME, InternalHDRPercentileRanks::new));
    registerAggregation(new AggregationSpec(CardinalityAggregationBuilder.NAME, CardinalityAggregationBuilder::new, CardinalityAggregationBuilder::parse).addResultReader(InternalCardinality::new));
    registerAggregation(new AggregationSpec(GlobalAggregationBuilder.NAME, GlobalAggregationBuilder::new, GlobalAggregationBuilder::parse).addResultReader(InternalGlobal::new));
    registerAggregation(new AggregationSpec(MissingAggregationBuilder.NAME, MissingAggregationBuilder::new, MissingAggregationBuilder::parse).addResultReader(InternalMissing::new));
    registerAggregation(new AggregationSpec(FilterAggregationBuilder.NAME, FilterAggregationBuilder::new, FilterAggregationBuilder::parse).addResultReader(InternalFilter::new));
    registerAggregation(new AggregationSpec(FiltersAggregationBuilder.NAME, FiltersAggregationBuilder::new, FiltersAggregationBuilder::parse).addResultReader(InternalFilters::new));
    registerAggregation(new AggregationSpec(AdjacencyMatrixAggregationBuilder.NAME, AdjacencyMatrixAggregationBuilder::new, AdjacencyMatrixAggregationBuilder.getParser()).addResultReader(InternalAdjacencyMatrix::new));
    registerAggregation(new AggregationSpec(SamplerAggregationBuilder.NAME, SamplerAggregationBuilder::new, SamplerAggregationBuilder::parse).addResultReader(InternalSampler.NAME, InternalSampler::new).addResultReader(UnmappedSampler.NAME, UnmappedSampler::new));
    registerAggregation(new AggregationSpec(DiversifiedAggregationBuilder.NAME, DiversifiedAggregationBuilder::new, DiversifiedAggregationBuilder::parse));
    registerAggregation(new AggregationSpec(TermsAggregationBuilder.NAME, TermsAggregationBuilder::new, TermsAggregationBuilder::parse).addResultReader(StringTerms.NAME, StringTerms::new).addResultReader(UnmappedTerms.NAME, UnmappedTerms::new).addResultReader(LongTerms.NAME, LongTerms::new).addResultReader(DoubleTerms.NAME, DoubleTerms::new));
    registerAggregation(new AggregationSpec(SignificantTermsAggregationBuilder.NAME, SignificantTermsAggregationBuilder::new, SignificantTermsAggregationBuilder.getParser(significanceHeuristicParserRegistry)).addResultReader(SignificantStringTerms.NAME, SignificantStringTerms::new).addResultReader(SignificantLongTerms.NAME, SignificantLongTerms::new).addResultReader(UnmappedSignificantTerms.NAME, UnmappedSignificantTerms::new));
    registerAggregation(new AggregationSpec(RangeAggregationBuilder.NAME, RangeAggregationBuilder::new, RangeAggregationBuilder::parse).addResultReader(InternalRange::new));
    registerAggregation(new AggregationSpec(DateRangeAggregationBuilder.NAME, DateRangeAggregationBuilder::new, DateRangeAggregationBuilder::parse).addResultReader(InternalDateRange::new));
    registerAggregation(new AggregationSpec(IpRangeAggregationBuilder.NAME, IpRangeAggregationBuilder::new, IpRangeAggregationBuilder::parse).addResultReader(InternalBinaryRange::new));
    registerAggregation(new AggregationSpec(HistogramAggregationBuilder.NAME, HistogramAggregationBuilder::new, HistogramAggregationBuilder::parse).addResultReader(InternalHistogram::new));
    registerAggregation(new AggregationSpec(DateHistogramAggregationBuilder.NAME, DateHistogramAggregationBuilder::new, DateHistogramAggregationBuilder::parse).addResultReader(InternalDateHistogram::new));
    registerAggregation(new AggregationSpec(GeoDistanceAggregationBuilder.NAME, GeoDistanceAggregationBuilder::new, GeoDistanceAggregationBuilder::parse).addResultReader(InternalGeoDistance::new));
    registerAggregation(new AggregationSpec(GeoGridAggregationBuilder.NAME, GeoGridAggregationBuilder::new, GeoGridAggregationBuilder::parse).addResultReader(InternalGeoHashGrid::new));
    registerAggregation(new AggregationSpec(NestedAggregationBuilder.NAME, NestedAggregationBuilder::new, NestedAggregationBuilder::parse).addResultReader(InternalNested::new));
    registerAggregation(new AggregationSpec(ReverseNestedAggregationBuilder.NAME, ReverseNestedAggregationBuilder::new, ReverseNestedAggregationBuilder::parse).addResultReader(InternalReverseNested::new));
    registerAggregation(new AggregationSpec(TopHitsAggregationBuilder.NAME, TopHitsAggregationBuilder::new, TopHitsAggregationBuilder::parse).addResultReader(InternalTopHits::new));
    registerAggregation(new AggregationSpec(GeoBoundsAggregationBuilder.NAME, GeoBoundsAggregationBuilder::new, GeoBoundsAggregationBuilder::parse).addResultReader(InternalGeoBounds::new));
    registerAggregation(new AggregationSpec(GeoCentroidAggregationBuilder.NAME, GeoCentroidAggregationBuilder::new, GeoCentroidAggregationBuilder::parse).addResultReader(InternalGeoCentroid::new));
    registerAggregation(new AggregationSpec(ScriptedMetricAggregationBuilder.NAME, ScriptedMetricAggregationBuilder::new, ScriptedMetricAggregationBuilder::parse).addResultReader(InternalScriptedMetric::new));
    registerAggregation(new AggregationSpec(ChildrenAggregationBuilder.NAME, ChildrenAggregationBuilder::new, ChildrenAggregationBuilder::parse).addResultReader(InternalChildren::new));
    registerFromPlugin(plugins, SearchPlugin::getAggregations, this::registerAggregation);
}
Also used : ReverseNestedAggregationBuilder(org.elasticsearch.search.aggregations.bucket.nested.ReverseNestedAggregationBuilder) StatsAggregationBuilder(org.elasticsearch.search.aggregations.metrics.stats.StatsAggregationBuilder) ExtendedStatsAggregationBuilder(org.elasticsearch.search.aggregations.metrics.stats.extended.ExtendedStatsAggregationBuilder) ExtendedStatsAggregationBuilder(org.elasticsearch.search.aggregations.metrics.stats.extended.ExtendedStatsAggregationBuilder) PipelineAggregationSpec(org.elasticsearch.plugins.SearchPlugin.PipelineAggregationSpec) AggregationSpec(org.elasticsearch.plugins.SearchPlugin.AggregationSpec) RangeAggregationBuilder(org.elasticsearch.search.aggregations.bucket.range.RangeAggregationBuilder) IpRangeAggregationBuilder(org.elasticsearch.search.aggregations.bucket.range.ip.IpRangeAggregationBuilder) DateRangeAggregationBuilder(org.elasticsearch.search.aggregations.bucket.range.date.DateRangeAggregationBuilder) ScriptedMetricAggregationBuilder(org.elasticsearch.search.aggregations.metrics.scripted.ScriptedMetricAggregationBuilder) ValueCountAggregationBuilder(org.elasticsearch.search.aggregations.metrics.valuecount.ValueCountAggregationBuilder) MaxAggregationBuilder(org.elasticsearch.search.aggregations.metrics.max.MaxAggregationBuilder) AdjacencyMatrixAggregationBuilder(org.elasticsearch.search.aggregations.bucket.adjacency.AdjacencyMatrixAggregationBuilder) StringTerms(org.elasticsearch.search.aggregations.bucket.terms.StringTerms) SignificantStringTerms(org.elasticsearch.search.aggregations.bucket.significant.SignificantStringTerms) GeoDistanceAggregationBuilder(org.elasticsearch.search.aggregations.bucket.range.geodistance.GeoDistanceAggregationBuilder) InternalTDigestPercentiles(org.elasticsearch.search.aggregations.metrics.percentiles.tdigest.InternalTDigestPercentiles) FiltersAggregationBuilder(org.elasticsearch.search.aggregations.bucket.filters.FiltersAggregationBuilder) GeoBoundsAggregationBuilder(org.elasticsearch.search.aggregations.metrics.geobounds.GeoBoundsAggregationBuilder) AvgAggregationBuilder(org.elasticsearch.search.aggregations.metrics.avg.AvgAggregationBuilder) NestedAggregationBuilder(org.elasticsearch.search.aggregations.bucket.nested.NestedAggregationBuilder) ReverseNestedAggregationBuilder(org.elasticsearch.search.aggregations.bucket.nested.ReverseNestedAggregationBuilder) DateHistogramAggregationBuilder(org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramAggregationBuilder) HistogramAggregationBuilder(org.elasticsearch.search.aggregations.bucket.histogram.HistogramAggregationBuilder) IpRangeAggregationBuilder(org.elasticsearch.search.aggregations.bucket.range.ip.IpRangeAggregationBuilder) FilterAggregationBuilder(org.elasticsearch.search.aggregations.bucket.filter.FilterAggregationBuilder) SignificantLongTerms(org.elasticsearch.search.aggregations.bucket.significant.SignificantLongTerms) TopHitsAggregationBuilder(org.elasticsearch.search.aggregations.metrics.tophits.TopHitsAggregationBuilder) DateHistogramAggregationBuilder(org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramAggregationBuilder) InternalTDigestPercentileRanks(org.elasticsearch.search.aggregations.metrics.percentiles.tdigest.InternalTDigestPercentileRanks) GeoCentroidAggregationBuilder(org.elasticsearch.search.aggregations.metrics.geocentroid.GeoCentroidAggregationBuilder) MissingAggregationBuilder(org.elasticsearch.search.aggregations.bucket.missing.MissingAggregationBuilder) ChildrenAggregationBuilder(org.elasticsearch.search.aggregations.bucket.children.ChildrenAggregationBuilder) InternalSampler(org.elasticsearch.search.aggregations.bucket.sampler.InternalSampler) GlobalAggregationBuilder(org.elasticsearch.search.aggregations.bucket.global.GlobalAggregationBuilder) SumAggregationBuilder(org.elasticsearch.search.aggregations.metrics.sum.SumAggregationBuilder) DateRangeAggregationBuilder(org.elasticsearch.search.aggregations.bucket.range.date.DateRangeAggregationBuilder) GeoGridAggregationBuilder(org.elasticsearch.search.aggregations.bucket.geogrid.GeoGridAggregationBuilder) SearchPlugin(org.elasticsearch.plugins.SearchPlugin) MinAggregationBuilder(org.elasticsearch.search.aggregations.metrics.min.MinAggregationBuilder) CardinalityAggregationBuilder(org.elasticsearch.search.aggregations.metrics.cardinality.CardinalityAggregationBuilder) LongTerms(org.elasticsearch.search.aggregations.bucket.terms.LongTerms) SignificantLongTerms(org.elasticsearch.search.aggregations.bucket.significant.SignificantLongTerms) SignificantTermsAggregationBuilder(org.elasticsearch.search.aggregations.bucket.significant.SignificantTermsAggregationBuilder)

Aggregations

FiltersAggregationBuilder (org.elasticsearch.search.aggregations.bucket.filters.FiltersAggregationBuilder)10 InternalFilters (org.elasticsearch.search.aggregations.bucket.filters.InternalFilters)4 IndexReader (org.apache.lucene.index.IndexReader)3 RandomIndexWriter (org.apache.lucene.index.RandomIndexWriter)3 IndexSearcher (org.apache.lucene.search.IndexSearcher)3 MatchAllDocsQuery (org.apache.lucene.search.MatchAllDocsQuery)3 Directory (org.apache.lucene.store.Directory)3 QueryBuilder (org.elasticsearch.index.query.QueryBuilder)3 Document (org.apache.lucene.document.Document)2 Field (org.apache.lucene.document.Field)2 XContentBuilder (org.elasticsearch.common.xcontent.XContentBuilder)2 MatchNoneQueryBuilder (org.elasticsearch.index.query.MatchNoneQueryBuilder)2 FiltersAggregator (org.elasticsearch.search.aggregations.bucket.filters.FiltersAggregator)2 KeyedFilter (org.elasticsearch.search.aggregations.bucket.filters.FiltersAggregator.KeyedFilter)2 HashSet (java.util.HashSet)1 SearchResponse (org.elasticsearch.action.search.SearchResponse)1 BytesReference (org.elasticsearch.common.bytes.BytesReference)1 XContentParser (org.elasticsearch.common.xcontent.XContentParser)1 XContentType (org.elasticsearch.common.xcontent.XContentType)1 QueryParseContext (org.elasticsearch.index.query.QueryParseContext)1