Numeric field types
Integer, long, float, and double field types have corresponding range field types.
If your numeric field contains an identifier such as an ID, you can map this field as a to optimize for faster term-level queries. If you need to use range queries on this field, you can map this field as a numeric field type in addition to a keyword field type.
Create a mapping where integer_value is an integer field:
copy
copy
A scaled float field type is a floating-point value that is multiplied by the scale factor and stored as a long value. It takes all optional parameters taken by number field types, plus an additional scaling_factor parameter. The scale factor is required when creating a scaled float.
Scaled floats are useful for saving disk space. Larger scaling_factor values lead to better accuracy but higher space overhead.
Create a mapping where scaled
is a scaled_float field:
Index a document with a scaled_float value:
copy
The value will be stored as 23.
The following table lists the parameters accepted by numeric field types. All parameters are optional.