Package org.elasticsearch.search
Interface DocValueFormat
- All Superinterfaces:
NamedWriteable
,Writeable
- All Known Implementing Classes:
DocValueFormat.BinaryDocValueFormat
,DocValueFormat.BooleanDocValueFormat
,DocValueFormat.DateTime
,DocValueFormat.Decimal
,DocValueFormat.GeoHashDocValueFormat
,DocValueFormat.GeoTileDocValueFormat
,DocValueFormat.IpDocValueFormat
,DocValueFormat.RawDocValueFormat
,DocValueFormat.UnsignedLongShiftedDocValueFormat
A formatter for values as returned by the fielddata/doc-values APIs.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
Singleton, stateless formatter, for representing bytes as base64 stringsstatic class
Stateless, Singleton formatter for boolean values.static class
static class
static class
Singleton, stateless formatter for geo hash valuesstatic class
static class
Stateless, singleton formatter for IP address datastatic class
Singleton, stateless formatter for "Raw" values, generally taken to mean keywords and other strings.static class
DocValues format for unsigned 64 bit long values, that are stored as shifted signed 64 bit long values.Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
Field Summary
Modifier and TypeFieldDescriptionstatic
static DocValueFormat
static DocValueFormat
static DocValueFormat
static DocValueFormat
static DocValueFormat
static long
static DocValueFormat
static DocValueFormat
-
Method Summary
Modifier and TypeMethodDescriptionstatic DocValueFormat
enableFormatSortValues(DocValueFormat format)
default
format(double value)
Format a double value.default
format(long value)
Format a long value.default
format(org.apache.lucene.util.BytesRef value)
Format a binary value.default
value)
Formats a value of a sort field in a search response.default org.apache.lucene.util.BytesRef
value)
Parse a value that was formatted withformat(BytesRef)
back to the original BytesRef.default double
value, boolean roundUp, now)
Parse a value that was formatted withformat(double)
back to the original double value.default long
value, boolean roundUp, now)
Parse a value that was formatted withformat(long)
back to the original long value.static DocValueFormat
withNanosecondResolution(DocValueFormat format)
Methods inherited from interface org.elasticsearch.common.io.stream.NamedWriteable
getWriteableName
-
Field Details
-
MASK_2_63
static final long MASK_2_63- See Also:
- Constant Field Values
-
BIGINTEGER_2_64_MINUS_ONE
static final BIGINTEGER_2_64_MINUS_ONE -
RAW
-
BINARY
-
GEOHASH
-
GEOTILE
-
BOOLEAN
-
IP
-
UNSIGNED_LONG_SHIFTED
-
-
Method Details
-
format
default 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 thelong
anddate
fields. -
format
default 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
,double
ordate
fields. -
format
default format(org.apache.lucene.util.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 thekeyword
andip
fields. -
parseLong
default long parseLong( value, boolean roundUp, now)Parse a value that was formatted withformat(long)
back to the original long value. -
parseDouble
default double parseDouble( value, boolean roundUp, now)Parse a value that was formatted withformat(double)
back to the original double value. -
parseBytesRef
default org.apache.lucene.util.BytesRef parseBytesRef( value)Parse a value that was formatted withformat(BytesRef)
back to the original BytesRef. -
formatSortValue
default formatSortValue( value)Formats a value of a sort field in a search response. This is used bySearchSortValues
to avoid sending the internal representation of a value of a sort field in a search response. The default implementation formatsBytesRef
but leave other types as-is. -
withNanosecondResolution
-
enableFormatSortValues
-