Class IncludeExclude
- java.lang.Object
-
- org.elasticsearch.search.aggregations.bucket.terms.IncludeExclude
-
- All Implemented Interfaces:
Writeable
,ToXContent
,ToXContentFragment
public class IncludeExclude extends java.lang.Object implements Writeable, ToXContentFragment
Defines the include/exclude regular expression filtering for string terms aggregation. In this filtering logic, exclusion has precedence, where theinclude
is evaluated first and then theexclude
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
IncludeExclude.LongFilter
static class
IncludeExclude.OrdinalsFilter
class
IncludeExclude.PartitionedLongFilter
static class
IncludeExclude.SetBackedLongFilter
static class
IncludeExclude.StringFilter
-
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
-
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
-
Field Summary
Fields Modifier and Type Field Description static ParseField
EXCLUDE_FIELD
static ParseField
INCLUDE_FIELD
static ParseField
NUM_PARTITIONS_FIELD
static ParseField
PARTITION_FIELD
-
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
-
Constructor Summary
Constructors Constructor Description IncludeExclude(double[] includeValues, double[] excludeValues)
IncludeExclude(int partition, int numPartitions)
IncludeExclude(long[] includeValues, long[] excludeValues)
IncludeExclude(java.lang.String[] includeValues, java.lang.String[] excludeValues)
IncludeExclude(java.lang.String include, java.lang.String exclude)
IncludeExclude(java.util.SortedSet<org.apache.lucene.util.BytesRef> includeValues, java.util.SortedSet<org.apache.lucene.util.BytesRef> excludeValues)
IncludeExclude(org.apache.lucene.util.automaton.RegExp include, org.apache.lucene.util.automaton.RegExp exclude)
IncludeExclude(StreamInput in)
Read from a stream.
-
Method Summary
Modifier and Type Method Description IncludeExclude.LongFilter
convertToDoubleFilter()
IncludeExclude.LongFilter
convertToLongFilter(DocValueFormat format)
IncludeExclude.OrdinalsFilter
convertToOrdinalsFilter(DocValueFormat format)
IncludeExclude.StringFilter
convertToStringFilter(DocValueFormat format)
boolean
equals(java.lang.Object obj)
int
hashCode()
boolean
isPartitionBased()
boolean
isRegexBased()
static IncludeExclude
merge(IncludeExclude include, IncludeExclude exclude)
static IncludeExclude
parseExclude(XContentParser parser)
static IncludeExclude
parseInclude(XContentParser parser)
XContentBuilder
toXContent(XContentBuilder builder, ToXContent.Params params)
void
writeTo(StreamOutput out)
Write this into the StreamOutput.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentFragment
isFragment
-
-
-
-
Field Detail
-
INCLUDE_FIELD
public static final ParseField INCLUDE_FIELD
-
EXCLUDE_FIELD
public static final ParseField EXCLUDE_FIELD
-
PARTITION_FIELD
public static final ParseField PARTITION_FIELD
-
NUM_PARTITIONS_FIELD
public static final ParseField NUM_PARTITIONS_FIELD
-
-
Constructor Detail
-
IncludeExclude
public IncludeExclude(org.apache.lucene.util.automaton.RegExp include, org.apache.lucene.util.automaton.RegExp exclude)
- Parameters:
include
- The regular expression pattern for the terms to be includedexclude
- The regular expression pattern for the terms to be excluded
-
IncludeExclude
public IncludeExclude(java.lang.String include, java.lang.String exclude)
-
IncludeExclude
public IncludeExclude(java.util.SortedSet<org.apache.lucene.util.BytesRef> includeValues, java.util.SortedSet<org.apache.lucene.util.BytesRef> excludeValues)
- Parameters:
includeValues
- The terms to be includedexcludeValues
- The terms to be excluded
-
IncludeExclude
public IncludeExclude(java.lang.String[] includeValues, java.lang.String[] excludeValues)
-
IncludeExclude
public IncludeExclude(double[] includeValues, double[] excludeValues)
-
IncludeExclude
public IncludeExclude(long[] includeValues, long[] excludeValues)
-
IncludeExclude
public IncludeExclude(int partition, int numPartitions)
-
IncludeExclude
public IncludeExclude(StreamInput in) throws java.io.IOException
Read from a stream.- Throws:
java.io.IOException
-
-
Method Detail
-
merge
public static IncludeExclude merge(IncludeExclude include, IncludeExclude exclude)
-
parseInclude
public static IncludeExclude parseInclude(XContentParser parser) throws java.io.IOException
- Throws:
java.io.IOException
-
parseExclude
public static IncludeExclude parseExclude(XContentParser parser) throws java.io.IOException
- Throws:
java.io.IOException
-
writeTo
public void writeTo(StreamOutput out) throws java.io.IOException
Description copied from interface:Writeable
Write this into the StreamOutput.
-
isRegexBased
public boolean isRegexBased()
-
isPartitionBased
public boolean isPartitionBased()
-
convertToStringFilter
public IncludeExclude.StringFilter convertToStringFilter(DocValueFormat format)
-
convertToOrdinalsFilter
public IncludeExclude.OrdinalsFilter convertToOrdinalsFilter(DocValueFormat format)
-
convertToLongFilter
public IncludeExclude.LongFilter convertToLongFilter(DocValueFormat format)
-
convertToDoubleFilter
public IncludeExclude.LongFilter convertToDoubleFilter()
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
- Specified by:
toXContent
in interfaceToXContent
- Throws:
java.io.IOException
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
-