java.lang.Object
org.elasticsearch.search.aggregations.bucket.terms.IncludeExclude
All Implemented Interfaces:
Writeable, org.elasticsearch.common.xcontent.ToXContent, org.elasticsearch.common.xcontent.ToXContentFragment

public class IncludeExclude
extends java.lang.Object
implements Writeable, org.elasticsearch.common.xcontent.ToXContentFragment
Defines the include/exclude regular expression filtering for string terms aggregation. In this filtering logic, exclusion has precedence, where the include is evaluated first and then the exclude.
  • Field Details

    • INCLUDE_FIELD

      public static final org.elasticsearch.common.ParseField INCLUDE_FIELD
    • EXCLUDE_FIELD

      public static final org.elasticsearch.common.ParseField EXCLUDE_FIELD
    • PARTITION_FIELD

      public static final org.elasticsearch.common.ParseField PARTITION_FIELD
    • NUM_PARTITIONS_FIELD

      public static final org.elasticsearch.common.ParseField NUM_PARTITIONS_FIELD
  • Constructor Details

    • 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 included
      exclude - The regular expression pattern for the terms to be excluded
    • IncludeExclude

      public IncludeExclude​(org.apache.lucene.util.automaton.RegExp include, org.apache.lucene.util.automaton.RegExp exclude, java.util.SortedSet<org.apache.lucene.util.BytesRef> includeValues, java.util.SortedSet<org.apache.lucene.util.BytesRef> excludeValues)
    • IncludeExclude

      public IncludeExclude​(java.lang.String include, java.lang.String exclude, java.lang.String[] includeValues, java.lang.String[] excludeValues)
    • 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 included
      excludeValues - 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 Details

    • merge

      public static IncludeExclude merge​(IncludeExclude include, IncludeExclude exclude)
    • parseInclude

      public static IncludeExclude parseInclude​(org.elasticsearch.common.xcontent.XContentParser parser) throws java.io.IOException
      Throws:
      java.io.IOException
    • parseExclude

      public static IncludeExclude parseExclude​(org.elasticsearch.common.xcontent.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.
      Specified by:
      writeTo in interface Writeable
      Throws:
      java.io.IOException
    • 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 org.elasticsearch.common.xcontent.XContentBuilder toXContent​(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws java.io.IOException
      Specified by:
      toXContent in interface org.elasticsearch.common.xcontent.ToXContent
      Throws:
      java.io.IOException
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class java.lang.Object
    • equals

      public boolean equals​(java.lang.Object obj)
      Overrides:
      equals in class java.lang.Object