public class TermsAggregationBuilder extends ValuesSourceAggregationBuilder<ValuesSource,TermsAggregationBuilder> implements MultiBucketAggregationBuilder
ValuesSourceAggregationBuilder.LeafOnly<VS extends ValuesSource,AB extends ValuesSourceAggregationBuilder<VS,AB>>AggregationBuilder.CommonFieldsWriteable.Reader<V>, Writeable.Writer<V>ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params| Modifier and Type | Field and Description |
|---|---|
static ParseField |
EXECUTION_HINT_FIELD_NAME |
static ParseField |
MIN_DOC_COUNT_FIELD_NAME |
static java.lang.String |
NAME |
static ParseField |
ORDER_FIELD |
static ParseField |
REQUIRED_SIZE_FIELD_NAME |
static ParseField |
SHARD_MIN_DOC_COUNT_FIELD_NAME |
static ParseField |
SHARD_SIZE_FIELD_NAME |
static ParseField |
SHOW_TERM_DOC_COUNT_ERROR |
configmetaDatafactoriesBuilder, nameEMPTY_PARAMS| Constructor and Description |
|---|
TermsAggregationBuilder(StreamInput in)
Read from a stream.
|
TermsAggregationBuilder(java.lang.String name,
ValueType valueType) |
| Modifier and Type | Method and Description |
|---|---|
Aggregator.SubAggCollectionMode |
collectMode()
Expert: get the collection mode.
|
TermsAggregationBuilder |
collectMode(Aggregator.SubAggCollectionMode collectMode)
Expert: set the collection mode.
|
protected XContentBuilder |
doXContentBody(XContentBuilder builder,
ToXContent.Params params) |
java.lang.String |
executionHint()
Expert: gets an execution hint to the aggregation.
|
TermsAggregationBuilder |
executionHint(java.lang.String executionHint)
Expert: sets an execution hint to the aggregation.
|
java.lang.String |
getType()
The name of the type of aggregation built by this builder.
|
IncludeExclude |
includeExclude()
Get terms to include and exclude from the aggregation results
|
TermsAggregationBuilder |
includeExclude(IncludeExclude includeExclude)
Set terms to include and exclude from the aggregation results
|
protected ValuesSourceAggregatorFactory<ValuesSource,?> |
innerBuild(SearchContext context,
ValuesSourceConfig<ValuesSource> config,
AggregatorFactory<?> parent,
AggregatorFactories.Builder subFactoriesBuilder) |
protected boolean |
innerEquals(java.lang.Object obj) |
protected int |
innerHashCode() |
protected void |
innerWriteTo(StreamOutput out)
Write subclass's state to the stream.
|
long |
minDocCount()
Returns the minimum document count required per term
|
TermsAggregationBuilder |
minDocCount(long minDocCount)
Set the minimum document count terms should have in order to appear in
the response.
|
BucketOrder |
order()
Gets the order in which the buckets will be returned.
|
TermsAggregationBuilder |
order(BucketOrder order)
Set a new order on this builder and return the builder so that calls
can be chained.
|
TermsAggregationBuilder |
order(java.util.List<BucketOrder> orders)
Sets the order in which the buckets will be returned.
|
static AggregationBuilder |
parse(java.lang.String aggregationName,
XContentParser parser) |
protected boolean |
serializeTargetValueType()
Should this builder serialize its targetValueType? Defaults to false.
|
long |
shardMinDocCount()
Returns the minimum document count required per term, per shard
|
TermsAggregationBuilder |
shardMinDocCount(long shardMinDocCount)
Set the minimum document count terms should have on the shard in order to
appear in the response.
|
int |
shardSize()
Returns the number of term buckets per shard that are currently configured
|
TermsAggregationBuilder |
shardSize(int shardSize)
Sets the shard_size - indicating the number of term buckets each shard
will return to the coordinating node (the node that coordinates the
search execution).
|
boolean |
showTermDocCountError()
Get whether doc count error will be return for individual terms
|
TermsAggregationBuilder |
showTermDocCountError(boolean showTermDocCountError)
Set whether doc count error will be return for individual terms
|
int |
size()
Returns the number of term buckets currently configured
|
TermsAggregationBuilder |
size(int size)
Sets the size - indicating how many term buckets should be returned
(defaults to 10)
|
doBuild, doEquals, doHashCode, doWriteTo, field, field, format, format, internalXContent, missing, missing, resolveConfig, script, script, timeZone, timeZone, valueType, valueTypebuild, equals, getMetaData, getWriteableName, hashCode, setMetaData, subAggregation, subAggregation, subAggregations, toXContent, writeTodoRewrite, getName, getPipelineAggregations, getSubAggregations, rewrite, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitisFragmentpublic static final java.lang.String NAME
public static final ParseField EXECUTION_HINT_FIELD_NAME
public static final ParseField SHARD_SIZE_FIELD_NAME
public static final ParseField MIN_DOC_COUNT_FIELD_NAME
public static final ParseField SHARD_MIN_DOC_COUNT_FIELD_NAME
public static final ParseField REQUIRED_SIZE_FIELD_NAME
public static final ParseField SHOW_TERM_DOC_COUNT_ERROR
public static final ParseField ORDER_FIELD
public TermsAggregationBuilder(java.lang.String name,
ValueType valueType)
public TermsAggregationBuilder(StreamInput in) throws java.io.IOException
java.io.IOExceptionpublic static AggregationBuilder parse(java.lang.String aggregationName, XContentParser parser) throws java.io.IOException
java.io.IOExceptionprotected boolean serializeTargetValueType()
ValuesSourceAggregationBuilderserializeTargetValueType in class ValuesSourceAggregationBuilder<ValuesSource,TermsAggregationBuilder>protected void innerWriteTo(StreamOutput out) throws java.io.IOException
ValuesSourceAggregationBuilderinnerWriteTo in class ValuesSourceAggregationBuilder<ValuesSource,TermsAggregationBuilder>java.io.IOExceptionpublic TermsAggregationBuilder size(int size)
public int size()
public TermsAggregationBuilder shardSize(int shardSize)
public int shardSize()
public TermsAggregationBuilder minDocCount(long minDocCount)
public long minDocCount()
public TermsAggregationBuilder shardMinDocCount(long shardMinDocCount)
public long shardMinDocCount()
public TermsAggregationBuilder order(BucketOrder order)
public TermsAggregationBuilder order(java.util.List<BucketOrder> orders)
public BucketOrder order()
public TermsAggregationBuilder executionHint(java.lang.String executionHint)
public java.lang.String executionHint()
public TermsAggregationBuilder collectMode(Aggregator.SubAggCollectionMode collectMode)
public Aggregator.SubAggCollectionMode collectMode()
public TermsAggregationBuilder includeExclude(IncludeExclude includeExclude)
public IncludeExclude includeExclude()
public boolean showTermDocCountError()
public TermsAggregationBuilder showTermDocCountError(boolean showTermDocCountError)
protected ValuesSourceAggregatorFactory<ValuesSource,?> innerBuild(SearchContext context, ValuesSourceConfig<ValuesSource> config, AggregatorFactory<?> parent, AggregatorFactories.Builder subFactoriesBuilder) throws java.io.IOException
innerBuild in class ValuesSourceAggregationBuilder<ValuesSource,TermsAggregationBuilder>java.io.IOExceptionprotected XContentBuilder doXContentBody(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
doXContentBody in class ValuesSourceAggregationBuilder<ValuesSource,TermsAggregationBuilder>java.io.IOExceptionprotected int innerHashCode()
innerHashCode in class ValuesSourceAggregationBuilder<ValuesSource,TermsAggregationBuilder>protected boolean innerEquals(java.lang.Object obj)
innerEquals in class ValuesSourceAggregationBuilder<ValuesSource,TermsAggregationBuilder>public java.lang.String getType()
BaseAggregationBuildergetType in interface BaseAggregationBuilder