Enum Class RangeType

java.lang.Object
java.lang.Enum<RangeType>
org.elasticsearch.index.mapper.RangeType
All Implemented Interfaces:
Serializable, Comparable<RangeType>, Constable

public enum RangeType extends Enum<RangeType>
Enum defining the type of range
  • Enum Constant Details

  • Field Details

  • Method Details

    • values

      public static RangeType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static RangeType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • typeName

      public final String typeName()
      Get the associated type name.
    • getRangeField

      public abstract org.apache.lucene.document.Field getRangeField(String name, RangeFieldMapper.Range range)
    • createFields

      public List<org.apache.lucene.index.IndexableField> createFields(ParseContext context, String name, RangeFieldMapper.Range range, boolean indexed, boolean docValued, boolean stored)
    • parseValue

      public Object parseValue(Object value, boolean coerce, @Nullable DateMathParser dateMathParser)
    • formatValue

      public Object formatValue(Object value, DateFormatter formatter)
    • parseFrom

      public Object parseFrom(RangeFieldMapper.RangeFieldType fieldType, org.elasticsearch.common.xcontent.XContentParser parser, boolean coerce, boolean included) throws IOException
      parses from value. rounds according to included flag
      Throws:
      IOException
    • parseTo

      public Object parseTo(RangeFieldMapper.RangeFieldType fieldType, org.elasticsearch.common.xcontent.XContentParser parser, boolean coerce, boolean included) throws IOException
      parses to value. rounds according to included flag
      Throws:
      IOException
    • minValue

      public abstract Object minValue()
    • maxValue

      public abstract Object maxValue()
    • nextUp

      public abstract Object nextUp(Object value)
    • nextDown

      public abstract Object nextDown(Object value)
    • withinQuery

      public abstract org.apache.lucene.search.Query withinQuery(String field, Object from, Object to, boolean includeFrom, boolean includeTo)
    • containsQuery

      public abstract org.apache.lucene.search.Query containsQuery(String field, Object from, Object to, boolean includeFrom, boolean includeTo)
    • intersectsQuery

      public abstract org.apache.lucene.search.Query intersectsQuery(String field, Object from, Object to, boolean includeFrom, boolean includeTo)
    • rangeQuery

      public org.apache.lucene.search.Query rangeQuery(String field, boolean hasDocValues, Object from, Object to, boolean includeFrom, boolean includeTo, ShapeRelation relation, @Nullable ZoneId timeZone, @Nullable DateMathParser dateMathParser, SearchExecutionContext context)
    • createRangeQuery

      protected final org.apache.lucene.search.Query createRangeQuery(String field, boolean hasDocValues, Object lower, Object upper, boolean includeFrom, boolean includeTo, ShapeRelation relation)
    • encodeRanges

      public abstract org.apache.lucene.util.BytesRef encodeRanges(Set<RangeFieldMapper.Range> ranges) throws IOException
      Throws:
      IOException
    • decodeRanges

      public abstract List<RangeFieldMapper.Range> decodeRanges(org.apache.lucene.util.BytesRef bytes)
    • doubleValue

      public abstract Double doubleValue(Object endpointValue)
      Given the Range.to or Range.from Object value from a Range instance, converts that value into a Double. Before converting, it asserts that the object is of the expected type. Operation is not supported on IP ranges (because of loss of precision)
      Parameters:
      endpointValue - Object value for Range.to or Range.from
      Returns:
      endpointValue as a Double
    • isNumeric

      public boolean isNumeric()
    • dvRangeQuery

      public abstract org.apache.lucene.search.Query dvRangeQuery(String field, BinaryDocValuesRangeQuery.QueryType queryType, Object from, Object to, boolean includeFrom, boolean includeTo)
    • parser

      public final Mapper.TypeParser parser()