Class NativeEsAggregate
- java.lang.Object
-
- org.nuxeo.ecm.platform.query.core.AggregateBase<B>
-
- org.nuxeo.elasticsearch.aggregate.AggregateEsBase<org.elasticsearch.search.aggregations.Aggregation,Bucket>
-
- org.nuxeo.elasticsearch.aggregate.NativeEsAggregate
-
public class NativeEsAggregate extends AggregateEsBase<org.elasticsearch.search.aggregations.Aggregation,Bucket>
This class is intended for internal/advanced use. It supports any ElasticSearch aggregate builder as a constructor parameter. However, it doesn't support Nuxeo page providers or the aggregation factory. The other aggregate classes are the preferred approach.- Since:
- 10.3
-
-
Field Summary
Fields Modifier and Type Field Description protected org.elasticsearch.search.aggregations.AggregationBuilder
nativeAggregation
protected Consumer<org.elasticsearch.search.aggregations.Aggregation>
parser
-
Fields inherited from class org.nuxeo.elasticsearch.aggregate.AggregateEsBase
ES_MUTLI_LEVEL_SEP, MAX_AGG_SIZE, XPATH_SEP
-
Fields inherited from class org.nuxeo.ecm.platform.query.core.AggregateBase
bucketMap, buckets, definition, extendedBuckets, searchDocument, selection
-
-
Constructor Summary
Constructors Constructor Description NativeEsAggregate(org.elasticsearch.search.aggregations.AggregationBuilder nativeAggregation, Consumer<org.elasticsearch.search.aggregations.Aggregation> parser)
Construct the aggregate using an ElasticSearch aggregate builder and a parser that will consume the response.NativeEsAggregate(AggregateDefinition definition, org.elasticsearch.search.aggregations.AggregationBuilder nativeAggregation, Consumer<org.elasticsearch.search.aggregations.Aggregation> parser)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description org.elasticsearch.search.aggregations.AggregationBuilder
getEsAggregate()
Return the Elasticsearch aggregate builderorg.elasticsearch.index.query.QueryBuilder
getEsFilter()
Return the Elasticsearch aggregate filter corresponding to the selectionprotected static AggregateDefinition
makeDefinition(org.elasticsearch.search.aggregations.AggregationBuilder nativeAggregation)
For backwards compatibility make an AggregateDefinition.void
parseAggregation(org.elasticsearch.search.aggregations.Aggregation aggregation)
Extract the aggregation from the Elasticsearch responseString
toString()
-
Methods inherited from class org.nuxeo.elasticsearch.aggregate.AggregateEsBase
getAggSize, getField, getXPathField
-
Methods inherited from class org.nuxeo.ecm.platform.query.core.AggregateBase
getBucket, getBucketMap, getBuckets, getDateRanges, getExtendedBuckets, getId, getProperties, getRanges, getSearchDocument, getSelection, getType, hasBucket, resetSelection, setBuckets, setSelection
-
-
-
-
Field Detail
-
nativeAggregation
protected final org.elasticsearch.search.aggregations.AggregationBuilder nativeAggregation
-
parser
protected final Consumer<org.elasticsearch.search.aggregations.Aggregation> parser
-
-
Constructor Detail
-
NativeEsAggregate
public NativeEsAggregate(AggregateDefinition definition, org.elasticsearch.search.aggregations.AggregationBuilder nativeAggregation, Consumer<org.elasticsearch.search.aggregations.Aggregation> parser)
-
NativeEsAggregate
public NativeEsAggregate(org.elasticsearch.search.aggregations.AggregationBuilder nativeAggregation, Consumer<org.elasticsearch.search.aggregations.Aggregation> parser)
Construct the aggregate using an ElasticSearch aggregate builder and a parser that will consume the response.
-
-
Method Detail
-
makeDefinition
protected static AggregateDefinition makeDefinition(org.elasticsearch.search.aggregations.AggregationBuilder nativeAggregation)
For backwards compatibility make an AggregateDefinition.
-
getEsAggregate
public org.elasticsearch.search.aggregations.AggregationBuilder getEsAggregate()
Description copied from class:AggregateEsBase
Return the Elasticsearch aggregate builder- Specified by:
getEsAggregate
in classAggregateEsBase<org.elasticsearch.search.aggregations.Aggregation,Bucket>
-
getEsFilter
public org.elasticsearch.index.query.QueryBuilder getEsFilter()
Description copied from class:AggregateEsBase
Return the Elasticsearch aggregate filter corresponding to the selection- Specified by:
getEsFilter
in classAggregateEsBase<org.elasticsearch.search.aggregations.Aggregation,Bucket>
-
parseAggregation
public void parseAggregation(org.elasticsearch.search.aggregations.Aggregation aggregation)
Description copied from class:AggregateEsBase
Extract the aggregation from the Elasticsearch response- Specified by:
parseAggregation
in classAggregateEsBase<org.elasticsearch.search.aggregations.Aggregation,Bucket>
-
toString
public String toString()
- Overrides:
toString
in classAggregateBase<Bucket>
-
-