NamedWriteable
, Writeable
, ToXContent
, ToXContentFragment
, BaseAggregationBuilder
, MultiBucketAggregationBuilder
public class FiltersAggregationBuilder extends AbstractAggregationBuilder<FiltersAggregationBuilder> implements MultiBucketAggregationBuilder
AggregationBuilder.CommonFields
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Writeable.Reader<V>, Writeable.Writer<V>
Modifier and Type | Field | Description |
---|---|---|
static java.lang.String |
NAME |
metaData
factoriesBuilder, name
EMPTY_PARAMS
Constructor | Description |
---|---|
FiltersAggregationBuilder(java.lang.String name,
QueryBuilder... filters) |
|
FiltersAggregationBuilder(java.lang.String name,
FiltersAggregator.KeyedFilter... filters) |
|
FiltersAggregationBuilder(StreamInput in) |
Read from a stream.
|
FiltersAggregationBuilder(FiltersAggregationBuilder clone,
AggregatorFactories.Builder factoriesBuilder,
java.util.Map<java.lang.String,java.lang.Object> metaData) |
Modifier and Type | Method | Description |
---|---|---|
protected AggregatorFactory<?> |
doBuild(SearchContext context,
AggregatorFactory<?> parent,
AggregatorFactories.Builder subFactoriesBuilder) |
|
protected boolean |
doEquals(java.lang.Object obj) |
|
protected int |
doHashCode() |
|
protected AggregationBuilder |
doRewrite(QueryRewriteContext queryShardContext) |
Rewrites this aggregation builder into its primitive form.
|
protected void |
doWriteTo(StreamOutput out) |
|
java.util.List<FiltersAggregator.KeyedFilter> |
filters() |
Get the filters.
|
java.lang.String |
getType() |
The name of the type of aggregation built by this builder.
|
protected XContentBuilder |
internalXContent(XContentBuilder builder,
ToXContent.Params params) |
|
boolean |
isKeyed() |
|
boolean |
otherBucket() |
Get whether to include a bucket for documents not matching any filter
|
FiltersAggregationBuilder |
otherBucket(boolean otherBucket) |
Set whether to include a bucket for documents not matching any filter
|
java.lang.String |
otherBucketKey() |
Get the key to use for the bucket for documents not matching any
filter.
|
FiltersAggregationBuilder |
otherBucketKey(java.lang.String otherBucketKey) |
Set the key to use for the bucket for documents not matching any
filter.
|
static FiltersAggregationBuilder |
parse(java.lang.String aggregationName,
XContentParser parser) |
|
protected AggregationBuilder |
shallowCopy(AggregatorFactories.Builder factoriesBuilder,
java.util.Map<java.lang.String,java.lang.Object> metaData) |
Create a shallow copy of this builder and replacing
AggregationBuilder.factoriesBuilder and metaData . |
build, equals, getMetaData, getWriteableName, hashCode, setMetaData, subAggregation, subAggregation, subAggregations, toXContent, writeTo
getName, getPipelineAggregations, getSubAggregations, rewrite, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
isFragment
public static final java.lang.String NAME
public FiltersAggregationBuilder(java.lang.String name, FiltersAggregator.KeyedFilter... filters)
name
- the name of this aggregationfilters
- the KeyedFilters to use with this aggregation.public FiltersAggregationBuilder(java.lang.String name, QueryBuilder... filters)
name
- the name of this aggregationfilters
- the filters to use with this aggregationpublic FiltersAggregationBuilder(FiltersAggregationBuilder clone, AggregatorFactories.Builder factoriesBuilder, java.util.Map<java.lang.String,java.lang.Object> metaData)
public FiltersAggregationBuilder(StreamInput in) throws java.io.IOException
java.io.IOException
protected AggregationBuilder shallowCopy(AggregatorFactories.Builder factoriesBuilder, java.util.Map<java.lang.String,java.lang.Object> metaData)
AggregationBuilder
AggregationBuilder.factoriesBuilder
and metaData
.
Used by AggregationBuilder.rewrite(QueryRewriteContext)
.shallowCopy
in class AggregationBuilder
protected void doWriteTo(StreamOutput out) throws java.io.IOException
doWriteTo
in class AbstractAggregationBuilder<FiltersAggregationBuilder>
java.io.IOException
public FiltersAggregationBuilder otherBucket(boolean otherBucket)
public boolean otherBucket()
public java.util.List<FiltersAggregator.KeyedFilter> filters()
public boolean isKeyed()
public FiltersAggregationBuilder otherBucketKey(java.lang.String otherBucketKey)
public java.lang.String otherBucketKey()
protected AggregationBuilder doRewrite(QueryRewriteContext queryShardContext) throws java.io.IOException
AggregationBuilder
doRewrite
in class AggregationBuilder
java.io.IOException
protected AggregatorFactory<?> doBuild(SearchContext context, AggregatorFactory<?> parent, AggregatorFactories.Builder subFactoriesBuilder) throws java.io.IOException
doBuild
in class AbstractAggregationBuilder<FiltersAggregationBuilder>
java.io.IOException
protected XContentBuilder internalXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
internalXContent
in class AbstractAggregationBuilder<FiltersAggregationBuilder>
java.io.IOException
public static FiltersAggregationBuilder parse(java.lang.String aggregationName, XContentParser parser) throws java.io.IOException
java.io.IOException
protected int doHashCode()
doHashCode
in class AbstractAggregationBuilder<FiltersAggregationBuilder>
protected boolean doEquals(java.lang.Object obj)
doEquals
in class AbstractAggregationBuilder<FiltersAggregationBuilder>
public java.lang.String getType()
BaseAggregationBuilder
getType
in interface BaseAggregationBuilder