@StableMinor(version="11.0", sinceVersion="9.0") public class TermsAggregation extends Object implements ISizeAwareAggregation, IFieldAwareAggregation
ITermsAggregationResult
. This aggregation splits the documents in the context in
multiple buckets
accordingly to their aggregated field value. This aggregation
does not work with the following data types:
Constructor and Description |
---|
TermsAggregation(String id,
DocumentTypeField field)
Creates a new instance.
|
TermsAggregation(String id,
DocumentTypeField field,
Integer size)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addSubAggregation(IAggregation aggregation)
Adds the given sub-aggregation.
|
void |
addSubAggregations(IAggregation... aggregations)
Adds the given sub-aggregations.
|
void |
addSubAggregations(List<IAggregation> aggregations)
Adds the given sub-aggregations.
|
DocumentTypeField |
getField()
Returns the field this aggregation is bound to.
|
String |
getId()
Returns the aggregation identifier.
|
int |
getSize()
Returns the number of buckets to be returned in aggregation.
|
List<IAggregation> |
getSubAggregations()
Returns an unmodifiable list of the sub-aggregations.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getId
protected final String id
public TermsAggregation(String id, DocumentTypeField field)
null
as the size
.id
- the aggregation identifier.field
- the field that aggregation will be performed on.public TermsAggregation(String id, DocumentTypeField field, Integer size)
id
- the aggregation identifier.field
- the field that aggregation will be performed on.size
- the result size of this aggregation (maximum number of buckets). When not defined, 10 is assumed as
default. When set to 0
, it is assumed to be unlimited.public DocumentTypeField getField()
IFieldAwareAggregation
getField
in interface IFieldAwareAggregation
public int getSize()
ISizeAwareAggregation
getSize
in interface ISizeAwareAggregation
public void addSubAggregation(IAggregation aggregation)
ISubAggregationAwareAggregation
addSubAggregation
in interface ISubAggregationAwareAggregation
public List<IAggregation> getSubAggregations()
ISubAggregationAwareAggregation
getSubAggregations
in interface ISubAggregationAwareAggregation
public void addSubAggregations(IAggregation... aggregations)
ISubAggregationAwareAggregation
addSubAggregations
in interface ISubAggregationAwareAggregation
aggregations
- the sub-aggregations.public void addSubAggregations(List<IAggregation> aggregations)
ISubAggregationAwareAggregation
addSubAggregations
in interface ISubAggregationAwareAggregation
aggregations
- the sub-aggregations.public String getId()
IAggregation
getId
in interface IAggregation
Lumisportal 11.0.0.180924 - Copyright © 2006–2018 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.