Module org.elasticsearch.server
Package org.elasticsearch.index.mapper
Enum Class NumberFieldMapper.NumberType
java.lang.Object
java.lang.Enum<NumberFieldMapper.NumberType>
org.elasticsearch.index.mapper.NumberFieldMapper.NumberType
- All Implemented Interfaces:
Serializable,Comparable<NumberFieldMapper.NumberType>,Constable
- Enclosing class:
NumberFieldMapper
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionabstract voidaddFields(LuceneDocument document, String name, Number value, boolean indexed, boolean docValued, boolean stored) Maps the givenvalueto one or more Lucene field values ands them to the givendocumentunder the givenname.compile(String fieldName, Script script, ScriptCompiler compiler) static org.apache.lucene.search.QuerydoubleRangeQuery(Object lowerTerm, Object upperTerm, boolean includeLower, boolean includeUpper, BiFunction<Double, Double, org.apache.lucene.search.Query> builder) abstract IndexFieldData.BuildergetFieldDataBuilder(MappedFieldType ft, ValuesSourceType valuesSourceType) getValueFetcherFieldDataBuilder(String name, ValuesSourceType valuesSourceType, SourceProvider sourceProvider, ValueFetcher valueFetcher) static booleanhasDecimalPart(Object number) Returns true if the object is a number and has a decimal partstatic org.apache.lucene.search.QuerylongRangeQuery(Object lowerTerm, Object upperTerm, boolean includeLower, boolean includeUpper, BiFunction<Long, Long, org.apache.lucene.search.Query> builder) Processes query bounds intolongs and delegates the providedbuilderto build a range query.Get the associated numeric typestatic doubleobjectToDouble(Object value) Converts an Object to a double by checking it against known types firststatic longobjectToLong(Object value, boolean coerce) Converts an Object to alongby checking it against known types and checking its range.abstract Numberabstract Numberparse(XContentParser parser, boolean coerce) abstract NumberparsePoint(byte[] value) final FieldMapper.TypeParserparser()abstract org.apache.lucene.search.QueryrangeQuery(String field, Object lowerTerm, Object upperTerm, boolean includeLower, boolean includeUpper, boolean hasDocValues, SearchExecutionContext context, boolean isIndexed) doublereduceToStoredPrecision(double value) Adjusts a value to the value it would have been had it been parsed by that mapper and then cast up to a double.abstract org.apache.lucene.search.Queryabstract org.apache.lucene.search.QuerytermsQuery(String field, Collection<?> values) abstract longtoSortableLong(Number value) For a givenNumber, returns the sortable long representation that will be stored in the doc values.final StringtypeName()Get the associated type name.static NumberFieldMapper.NumberTypeReturns the enum constant of this class with the specified name.static NumberFieldMapper.NumberType[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
HALF_FLOAT
-
FLOAT
-
DOUBLE
-
BYTE
-
SHORT
-
INTEGER
-
LONG
-
-
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. -
numericType
Get the associated numeric type -
parser
-
termQuery
-
termsQuery
-
rangeQuery
public abstract org.apache.lucene.search.Query rangeQuery(String field, Object lowerTerm, Object upperTerm, boolean includeLower, boolean includeUpper, boolean hasDocValues, SearchExecutionContext context, boolean isIndexed) -
parse
- Throws:
IOException
-
parse
-
parsePoint
-
addFields
public abstract void addFields(LuceneDocument document, String name, Number value, boolean indexed, boolean docValued, boolean stored) Maps the givenvalueto one or more Lucene field values ands them to the givendocumentunder the givenname.- Parameters:
document- document to add fields toname- field namevalue- value to mapindexed- whether or not the field is indexeddocValued- whether or not doc values should be addedstored- whether or not the field is stored
-
toSortableLong
For a givenNumber, returns the sortable long representation that will be stored in the doc values.- Parameters:
value- number to convert- Returns:
- sortable long representation
-
compile
-
hasDecimalPart
Returns true if the object is a number and has a decimal part -
objectToDouble
Converts an Object to a double by checking it against known types first -
objectToLong
Converts an Object to alongby checking it against known types and checking its range. -
doubleRangeQuery
public static org.apache.lucene.search.Query doubleRangeQuery(Object lowerTerm, Object upperTerm, boolean includeLower, boolean includeUpper, BiFunction<Double, Double, org.apache.lucene.search.Query> builder) -
longRangeQuery
public static org.apache.lucene.search.Query longRangeQuery(Object lowerTerm, Object upperTerm, boolean includeLower, boolean includeUpper, BiFunction<Long, Long, org.apache.lucene.search.Query> builder) Processes query bounds intolongs and delegates the providedbuilderto build a range query. -
getFieldDataBuilder
public abstract IndexFieldData.Builder getFieldDataBuilder(MappedFieldType ft, ValuesSourceType valuesSourceType) -
getValueFetcherFieldDataBuilder
public IndexFieldData.Builder getValueFetcherFieldDataBuilder(String name, ValuesSourceType valuesSourceType, SourceProvider sourceProvider, ValueFetcher valueFetcher) -
reduceToStoredPrecision
public double reduceToStoredPrecision(double value) Adjusts a value to the value it would have been had it been parsed by that mapper and then cast up to a double. This is meant to be an entry point to manipulate values before the actual value is parsed.- Parameters:
value- the value to reduce to the field stored value- Returns:
- the double value
-