Package org.elasticsearch.index.mapper
Enum RangeType
- java.lang.Object
-
- java.lang.Enum<RangeType>
-
- org.elasticsearch.index.mapper.RangeType
-
- All Implemented Interfaces:
Serializable,Comparable<RangeType>
public enum RangeType extends Enum<RangeType>
Enum defining the type of range
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRangeType.LengthType
-
Field Summary
Fields Modifier and Type Field Description RangeType.LengthTypelengthTypeStringname
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract QuerycontainsQuery(String field, Object from, Object to, boolean includeFrom, boolean includeTo)List<IndexableField>createFields(ParseContext context, String name, RangeFieldMapper.Range range, boolean indexed, boolean docValued, boolean stored)abstract List<RangeFieldMapper.Range>decodeRanges(BytesRef bytes)abstract DoubledoubleValue(Object endpointValue)Given the Range.to or Range.from Object value from a Range instance, converts that value into a Double.abstract QuerydvRangeQuery(String field, BinaryDocValuesRangeQuery.QueryType queryType, Object from, Object to, boolean includeFrom, boolean includeTo)abstract BytesRefencodeRanges(Set<RangeFieldMapper.Range> ranges)abstract FieldgetRangeField(String name, RangeFieldMapper.Range range)abstract QueryintersectsQuery(String field, Object from, Object to, boolean includeFrom, boolean includeTo)booleanisNumeric()abstract ObjectmaxValue()abstract ObjectminValue()abstract ObjectnextDown(Object value)abstract ObjectnextUp(Object value)Objectparse(Object value, boolean coerce)ObjectparseFrom(RangeFieldMapper.RangeFieldType fieldType, XContentParser parser, boolean coerce, boolean included)parses from value.ObjectparseTo(RangeFieldMapper.RangeFieldType fieldType, XContentParser parser, boolean coerce, boolean included)parses to value.QueryrangeQuery(String field, boolean hasDocValues, Object from, Object to, boolean includeFrom, boolean includeTo, ShapeRelation relation, ZoneId timeZone, DateMathParser dateMathParser, QueryShardContext context)StringtypeName()Get the associated type name.static RangeTypevalueOf(String name)Returns the enum constant of this type with the specified name.static RangeType[]values()Returns an array containing the constants of this enum type, in the order they are declared.abstract QuerywithinQuery(String field, Object from, Object to, boolean includeFrom, boolean includeTo)
-
-
-
Field Detail
-
name
public final String name
-
lengthType
public final RangeType.LengthType lengthType
-
-
Method Detail
-
values
public static RangeType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (RangeType c : RangeType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static RangeType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified nameNullPointerException- if the argument is null
-
typeName
public final String typeName()
Get the associated type name.
-
getRangeField
public abstract Field getRangeField(String name, RangeFieldMapper.Range range)
-
createFields
public List<IndexableField> createFields(ParseContext context, String name, RangeFieldMapper.Range range, boolean indexed, boolean docValued, boolean stored)
-
parseFrom
public Object parseFrom(RangeFieldMapper.RangeFieldType fieldType, 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, 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()
-
withinQuery
public abstract Query withinQuery(String field, Object from, Object to, boolean includeFrom, boolean includeTo)
-
containsQuery
public abstract Query containsQuery(String field, Object from, Object to, boolean includeFrom, boolean includeTo)
-
intersectsQuery
public abstract Query intersectsQuery(String field, Object from, Object to, boolean includeFrom, boolean includeTo)
-
rangeQuery
public Query rangeQuery(String field, boolean hasDocValues, Object from, Object to, boolean includeFrom, boolean includeTo, ShapeRelation relation, @Nullable ZoneId timeZone, @Nullable DateMathParser dateMathParser, QueryShardContext context)
-
encodeRanges
public abstract BytesRef encodeRanges(Set<RangeFieldMapper.Range> ranges) throws IOException
- Throws:
IOException
-
decodeRanges
public abstract List<RangeFieldMapper.Range> decodeRanges(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 Query dvRangeQuery(String field, BinaryDocValuesRangeQuery.QueryType queryType, Object from, Object to, boolean includeFrom, boolean includeTo)
-
-