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

public interface DocValueFormat extends NamedWriteable
A formatter for values as returned by the fielddata/doc-values APIs.
  • Field Details

  • Method Details

    • 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 the long and date fields.
    • 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 the long, double or date fields.
    • format

      default Object 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 the keyword and ip fields.
    • parseLong

      default long parseLong(String value, boolean roundUp, LongSupplier now)
      Parse a value that was formatted with format(long) back to the original long value.
    • parseDouble

      default double parseDouble(String value, boolean roundUp, LongSupplier now)
      Parse a value that was formatted with format(double) back to the original double value.
    • parseBytesRef

      default org.apache.lucene.util.BytesRef parseBytesRef(String value)
      Parse a value that was formatted with format(BytesRef) back to the original BytesRef.
    • formatSortValue

      default Object formatSortValue(Object value)
      Formats a value of a sort field in a search response. This is used by SearchSortValues to avoid sending the internal representation of a value of a sort field in a search response. The default implementation formats BytesRef but leave other types as-is.
    • withNanosecondResolution

      static DocValueFormat withNanosecondResolution(DocValueFormat format)
    • enableFormatSortValues

      static DocValueFormat enableFormatSortValues(DocValueFormat format)