Search in sources :

Example 6 with AggregationQueries

use of com.enonic.xp.query.aggregation.AggregationQueries in project xp by enonic.

the class QueryAggregationParams method addSubAggregations.

private void addSubAggregations(final BucketAggregationQuery.Builder aggregationQuery, final Map<String, Object> aggregationQueryMap) {
    if (aggregationQueryMap.containsKey("aggregations")) {
        final Map<String, Object> aggregationsMap = (Map<String, Object>) aggregationQueryMap.get("aggregations");
        final AggregationQueries aggregation = getAggregations(aggregationsMap);
        aggregationQuery.addSubQueries(aggregation.getSet());
    }
}
Also used : AggregationQueries(com.enonic.xp.query.aggregation.AggregationQueries) Map(java.util.Map) Collections.emptyMap(java.util.Collections.emptyMap)

Aggregations

AggregationQueries (com.enonic.xp.query.aggregation.AggregationQueries)6 TermsAggregationQuery (com.enonic.xp.query.aggregation.TermsAggregationQuery)3 HashMap (java.util.HashMap)3 Test (org.junit.jupiter.api.Test)3 MaxAggregationQuery (com.enonic.xp.query.aggregation.metric.MaxAggregationQuery)2 MinAggregationQuery (com.enonic.xp.query.aggregation.metric.MinAggregationQuery)2 ValueCountAggregationQuery (com.enonic.xp.query.aggregation.metric.ValueCountAggregationQuery)2 AggregationQuery (com.enonic.xp.query.aggregation.AggregationQuery)1 BucketAggregationQuery (com.enonic.xp.query.aggregation.BucketAggregationQuery)1 DateHistogramAggregationQuery (com.enonic.xp.query.aggregation.DateHistogramAggregationQuery)1 DateRangeAggregationQuery (com.enonic.xp.query.aggregation.DateRangeAggregationQuery)1 GeoDistanceAggregationQuery (com.enonic.xp.query.aggregation.GeoDistanceAggregationQuery)1 HistogramAggregationQuery (com.enonic.xp.query.aggregation.HistogramAggregationQuery)1 NumericRangeAggregationQuery (com.enonic.xp.query.aggregation.NumericRangeAggregationQuery)1 StatsAggregationQuery (com.enonic.xp.query.aggregation.metric.StatsAggregationQuery)1 QueryExpr (com.enonic.xp.query.expr.QueryExpr)1 Filters (com.enonic.xp.query.filter.Filters)1 HighlightQuery (com.enonic.xp.query.highlight.HighlightQuery)1 SuggestionQueries (com.enonic.xp.query.suggester.SuggestionQueries)1 Collections.emptyMap (java.util.Collections.emptyMap)1