DoubleDocValuesField (Lucene 10.5.0 core API)
Description: declaration: package: org.apache.lucene.document, class: DoubleDocValuesField

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 via `Double.doubleToRawLongBits(double)`.

Per-document double values can be retrieved via `LeafReader.getNumericDocValues(String)`.

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.Store`

- ## Field Summary

  ### Fields inherited from class org.apache.lucene.document.NumericDocValuesField

  `TYPE`

  ### Fields inherited from class org.apache.lucene.document.Field

  `fieldsData, name, type`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DoubleDocValuesField(String name, double value)`
  Creates a new DocValues field with the specified 64-bit double value

- ## Method Summary

  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.NumericDocValuesField

  `indexedField, newSlowExactQuery, newSlowRangeQuery, newSlowSetQuery`

  ### Methods inherited from class org.apache.lucene.document.Field

  `binaryValue, fieldType, getCharSequenceValue, invertableType, name, numericValue, readerValue, setBytesValue, setBytesValue, setByteValue, setFloatValue, setIntValue, setReaderValue, setShortValue, setStringValue, setTokenStream, storedValue, stringValue, tokenStream, tokenStreamValue, toString`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### DoubleDocValuesField

    public DoubleDocValuesField(String name, double value)
    Creates a new DocValues field with the specified 64-bit double value
    Parameters:
      `name` - field name
      `value` - 64-bit double value
    Throws:
      `IllegalArgumentException` - if the field name is null

- ## Method Details

  - ### setDoubleValue

    public void setDoubleValue(double value)
    Description copied from class: `Field`
    Expert: change the value of this field. See `Field.setStringValue(String)`.
    Overrides:
      `setDoubleValue` in class `Field`

  - ### setLongValue

    public void setLongValue(long value)
    Description copied from class: `Field`
    Expert: change the value of this field. See `Field.setStringValue(String)`.
    Overrides:
      `setLongValue` in class `Field`