Class FloatDocValuesField

All Implemented Interfaces:
IndexableField

public class FloatDocValuesField extends NumericDocValuesField
Syntactic sugar for encoding floats as NumericDocValues via Float.floatToRawIntBits(float).

Per-document floating point values can be retrieved via LeafReader.getNumericDocValues(String).

NOTE: In most all cases this will be rather inefficient, requiring four bytes per document. Consider encoding floating point values yourself with only as much precision as you require.

  • Constructor Details

    • FloatDocValuesField

      public FloatDocValuesField(String name, float value)
      Creates a new DocValues field with the specified 32-bit float value
      Parameters:
      name - field name
      value - 32-bit float value
      Throws:
      IllegalArgumentException - if the field name is null
  • Method Details