break; case Expression.MAX: aggregationBuilder = AggregationBuilders.max(function.toParsedText()).field(jPAColumnName); break; case Expression.SUM:
/** * Create a new {@link Max} aggregation with the given name. */ public static MaxBuilder max(String name) { return new MaxBuilder(name); }
.subAggregation( AggregationBuilders.max(SCORE_AGGREGATION) .script(new Script("_score", ScriptService.ScriptType.INLINE, "expression", null))) .subAggregation(topHitsBuilder);
private Map<String, Double> getFieldBoundaries(){ SearchRequestBuilder boundsRequest = this.client.prepareSearch(this.index) .setTypes("datum") .setSearchType(SearchType.COUNT) .addAggregation( AggregationBuilders.min("minX").field(this.xField) ).addAggregation( AggregationBuilders.min("minY").field(this.yField) ).addAggregation( AggregationBuilders.max("maxX").field(this.xField) ).addAggregation( AggregationBuilders.max("maxY").field(this.yField) ); SearchResponse searchResponse = boundsRequest.execute().actionGet(); Aggregations aggregations = searchResponse.getAggregations(); Min minX = aggregations.get("minX"); Min minY = aggregations.get("minY"); Max maxX = aggregations.get("maxX"); Max maxY = aggregations.get("maxY"); Map<String, Double> boundsMap = new HashMap<>(); boundsMap.put("minX", minX.getValue()); boundsMap.put("minY", minY.getValue()); boundsMap.put("maxX", maxX.getValue()); boundsMap.put("maxY", maxY.getValue()); return boundsMap; }
.filter(QueryBuilders.existsQuery(Message.FIELD_TIMESTAMP)) .subAggregation(AggregationBuilders.min("ts_min").field(Message.FIELD_TIMESTAMP)) .subAggregation(AggregationBuilders.max("ts_max").field(Message.FIELD_TIMESTAMP)) .subAggregation(AggregationBuilders.terms("streams").field(Message.FIELD_STREAMS)); final String query = searchSource()
break; case Expression.MAX: aggregationBuilder = AggregationBuilders.max(function.toParsedText()).field(jPAColumnName); break; case Expression.SUM: