Package org.apache.lucene.document
Class FloatDocValuesField
java.lang.Object
org.apache.lucene.document.Field
org.apache.lucene.document.NumericDocValuesField
org.apache.lucene.document.FloatDocValuesField
- All Implemented Interfaces:
IndexableField
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.lucene.document.Field
Field.Store -
Field Summary
Fields inherited from class org.apache.lucene.document.NumericDocValuesField
TYPEFields inherited from class org.apache.lucene.document.Field
fieldsData, name, type -
Constructor Summary
ConstructorsConstructorDescriptionFloatDocValuesField(String name, float value) Creates a new DocValues field with the specified 32-bit float value -
Method Summary
Modifier and TypeMethodDescriptionvoidsetFloatValue(float value) Expert: change the value of this field.voidsetLongValue(long value) Expert: change the value of this field.Methods inherited from class org.apache.lucene.document.NumericDocValuesField
indexedField, newSlowExactQuery, newSlowRangeQuery, newSlowSetQueryMethods inherited from class org.apache.lucene.document.Field
binaryValue, fieldType, getCharSequenceValue, invertableType, name, numericValue, readerValue, setBytesValue, setBytesValue, setByteValue, setDoubleValue, setIntValue, setReaderValue, setShortValue, setStringValue, setTokenStream, storedValue, stringValue, tokenStream, tokenStreamValue, toString
-
Constructor Details
-
FloatDocValuesField
Creates a new DocValues field with the specified 32-bit float value- Parameters:
name- field namevalue- 32-bit float value- Throws:
IllegalArgumentException- if the field name is null
-
-
Method Details
-
setFloatValue
public void setFloatValue(float value) Description copied from class:FieldExpert: change the value of this field. SeeField.setStringValue(String).- Overrides:
setFloatValuein classField
-
setLongValue
public void setLongValue(long value) Description copied from class:FieldExpert: change the value of this field. SeeField.setStringValue(String).- Overrides:
setLongValuein classField
-