@StableMinor(version="12.4", sinceVersion="9.0") public class TermsAggregation extends AbstractSubAggregationAwareAggregation 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 |
---|---|
DocumentTypeField |
getField()
Returns the field this aggregation is bound to.
|
String |
getId()
Returns the aggregation identifier.
|
Long |
getMinimumDocumentCount()
Returns the minimum document count a value should have in order to produce a bucket in response
|
int |
getSize()
Returns the number of buckets to be returned in aggregation.
|
TermsAggregation |
setMinimunDocumentCount(Long minimunDocumentCount)
Sets the minimum document count a value should have in order to produce a bucket in response.
|
addSubAggregation, addSubAggregations, addSubAggregations, getSubAggregations
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 TermsAggregation setMinimunDocumentCount(Long minimunDocumentCount)
minimunDocumentCount
- the minimum document count.public Long getMinimumDocumentCount()
public String getId()
IAggregation
getId
in interface IAggregation
LumisXP 12.4.0.200625 - Copyright © 2006–2020 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.