Package org.elasticsearch.index.mapper
Enum Class RangeType
- All Implemented Interfaces:
Serializable
,Comparable<RangeType>
,Constable
Enum defining the type of range
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract org.apache.lucene.search.Query
containsQuery(String field, Object from, Object to, boolean includeFrom, boolean includeTo)
List<org.apache.lucene.index.IndexableField>
createFields(ParseContext context, String name, RangeFieldMapper.Range range, boolean indexed, boolean docValued, boolean stored)
protected org.apache.lucene.search.Query
createRangeQuery(String field, boolean hasDocValues, Object lower, Object upper, boolean includeFrom, boolean includeTo, ShapeRelation relation)
abstract List<RangeFieldMapper.Range>
decodeRanges(org.apache.lucene.util.BytesRef bytes)
abstract Double
doubleValue(Object endpointValue)
Given the Range.to or Range.from Object value from a Range instance, converts that value into a Double.abstract org.apache.lucene.search.Query
dvRangeQuery(String field, BinaryDocValuesRangeQuery.QueryType queryType, Object from, Object to, boolean includeFrom, boolean includeTo)
abstract org.apache.lucene.util.BytesRef
encodeRanges(Set<RangeFieldMapper.Range> ranges)
formatValue(Object value, DateFormatter formatter)
abstract org.apache.lucene.document.Field
getRangeField(String name, RangeFieldMapper.Range range)
abstract org.apache.lucene.search.Query
intersectsQuery(String field, Object from, Object to, boolean includeFrom, boolean includeTo)
boolean
abstract Object
maxValue()
abstract Object
minValue()
abstract Object
abstract Object
parseFrom(RangeFieldMapper.RangeFieldType fieldType, org.elasticsearch.common.xcontent.XContentParser parser, boolean coerce, boolean included)
parses from value.parser()
parseTo(RangeFieldMapper.RangeFieldType fieldType, org.elasticsearch.common.xcontent.XContentParser parser, boolean coerce, boolean included)
parses to value.parseValue(Object value, boolean coerce, DateMathParser dateMathParser)
org.apache.lucene.search.Query
rangeQuery(String field, boolean hasDocValues, Object from, Object to, boolean includeFrom, boolean includeTo, ShapeRelation relation, ZoneId timeZone, DateMathParser dateMathParser, SearchExecutionContext context)
typeName()
Get the associated type name.static RangeType
Returns the enum constant of this class with the specified name.static RangeType[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.abstract org.apache.lucene.search.Query
withinQuery(String field, Object from, Object to, boolean includeFrom, boolean includeTo)
-
Enum Constant Details
-
IP
-
DATE
-
FLOAT
-
DOUBLE
-
INTEGER
-
LONG
-
-
Field Details
-
name
-
lengthType
-
-
Method Details
-
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
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 nameNullPointerException
- if the argument is null
-
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
-
formatValue
-
parseFrom
public Object parseFrom(RangeFieldMapper.RangeFieldType fieldType, org.elasticsearch.common.xcontent.XContentParser parser, boolean coerce, boolean included) throws IOExceptionparses 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 IOExceptionparses to value. rounds according to included flag- Throws:
IOException
-
minValue
-
maxValue
-
nextUp
-
nextDown
-
withinQuery
-
containsQuery
-
intersectsQuery
-
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
-
doubleValue
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
-