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 FieldCache.getFloats(AtomicReader, String, boolean).

    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 Detail

      • FloatDocValuesField

        public FloatDocValuesField​(java.lang.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:
        java.lang.IllegalArgumentException - if the field name is null