Package org.elasticsearch.search
Interface DocValueFormat
-
- All Superinterfaces:
NamedWriteable,Writeable
- All Known Implementing Classes:
DocValueFormat.DateTime,DocValueFormat.Decimal
public interface DocValueFormat extends NamedWriteable
A formatter for values as returned by the fielddata/doc-values APIs.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classDocValueFormat.DateTimestatic classDocValueFormat.Decimal-
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
-
Field Summary
Fields Modifier and Type Field Description static DocValueFormatBINARYstatic DocValueFormatBOOLEANstatic DocValueFormatGEOHASHstatic DocValueFormatGEOTILEstatic DocValueFormatIPstatic DocValueFormatRAW
-
Method Summary
All Methods Static Methods Instance Methods Default Methods Modifier and Type Method Description default Objectformat(double value)Format a double value.default Objectformat(long value)Format a long value.default Objectformat(BytesRef value)Format a binary value.default BytesRefparseBytesRef(String value)Parse a value that was formatted withformat(BytesRef)back to the original BytesRef.default doubleparseDouble(String value, boolean roundUp, LongSupplier now)Parse a value that was formatted withformat(double)back to the original double value.default longparseLong(String value, boolean roundUp, LongSupplier now)Parse a value that was formatted withformat(long)back to the original long value.static DocValueFormatwithNanosecondResolution(DocValueFormat format)-
Methods inherited from interface org.elasticsearch.common.io.stream.NamedWriteable
getWriteableName
-
-
-
-
Field Detail
-
RAW
static final DocValueFormat RAW
-
BINARY
static final DocValueFormat BINARY
-
GEOHASH
static final DocValueFormat GEOHASH
-
GEOTILE
static final DocValueFormat GEOTILE
-
BOOLEAN
static final DocValueFormat BOOLEAN
-
IP
static final DocValueFormat IP
-
-
Method Detail
-
format
default Object format(long value)
Format a long value. This is used by terms and histogram aggregations to format keys for fields that use longs as a doc value representation such as thelonganddatefields.
-
format
default Object format(double value)
Format a double value. This is used by terms and stats aggregations to format keys for fields that use numbers as a doc value representation such as thelong,doubleordatefields.
-
format
default Object format(BytesRef value)
Format a binary value. This is used by terms aggregations to format keys for fields that use binary doc value representations such as thekeywordandipfields.
-
parseLong
default long parseLong(String value, boolean roundUp, LongSupplier now)
Parse a value that was formatted withformat(long)back to the original long value.
-
parseDouble
default double parseDouble(String value, boolean roundUp, LongSupplier now)
Parse a value that was formatted withformat(double)back to the original double value.
-
parseBytesRef
default BytesRef parseBytesRef(String value)
Parse a value that was formatted withformat(BytesRef)back to the original BytesRef.
-
withNanosecondResolution
static DocValueFormat withNanosecondResolution(DocValueFormat format)
-
-