Package org.apache.lucene.document
Class DoubleDocValuesField
- java.lang.Object
-
- org.apache.lucene.document.Field
-
- org.apache.lucene.document.NumericDocValuesField
-
- org.apache.lucene.document.DoubleDocValuesField
-
- All Implemented Interfaces:
IndexableField
public class DoubleDocValuesField extends NumericDocValuesField
Syntactic sugar for encoding doubles as NumericDocValues viaDouble.doubleToRawLongBits(double)
.Per-document double values can be retrieved via
FieldCache.getDoubles(AtomicReader, String, boolean)
.NOTE: In most all cases this will be rather inefficient, requiring eight bytes per document. Consider encoding double 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.Index, Field.Store, Field.TermVector
-
-
Field Summary
-
Fields inherited from class org.apache.lucene.document.NumericDocValuesField
TYPE
-
-
Constructor Summary
Constructors Constructor Description DoubleDocValuesField(java.lang.String name, double value)
Creates a new DocValues field with the specified 64-bit double value
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
setDoubleValue(double value)
Expert: change the value of this field.void
setLongValue(long value)
Expert: change the value of this field.-
Methods inherited from class org.apache.lucene.document.Field
binaryValue, boost, fieldType, name, numericValue, readerValue, setBoost, setBytesValue, setBytesValue, setByteValue, setFloatValue, setIntValue, setReaderValue, setShortValue, setStringValue, setTokenStream, stringValue, tokenStream, tokenStreamValue, toString, translateFieldType
-
-
-
-
Constructor Detail
-
DoubleDocValuesField
public DoubleDocValuesField(java.lang.String name, double value)
Creates a new DocValues field with the specified 64-bit double value- Parameters:
name
- field namevalue
- 64-bit double value- Throws:
java.lang.IllegalArgumentException
- if the field name is null
-
-
Method Detail
-
setDoubleValue
public void setDoubleValue(double value)
Description copied from class:Field
Expert: change the value of this field. SeeField.setStringValue(String)
.- Overrides:
setDoubleValue
in classField
-
setLongValue
public void setLongValue(long value)
Description copied from class:Field
Expert: change the value of this field. SeeField.setStringValue(String)
.- Overrides:
setLongValue
in classField
-
-