Package org.apache.lucene.codecs

# Class DocValuesProducer

java.lang.Object
org.apache.lucene.codecs.DocValuesProducer

All Implemented Interfaces:
  `Closeable`, `AutoCloseable`

Direct Known Subclasses:
  `EmptyDocValuesProducer`

public abstract class DocValuesProducer extends Object implements Closeable
Abstract API that produces numeric, binary, sorted, sortedset, and sortednumeric docvalues.

WARNING: This API is experimental and might change in incompatible ways in the next release.

## Constructor Summary

Constructors
Modifier
Constructor
Description
`protected`
`DocValuesProducer()`
Sole constructor.

## Method Summary

Modifier and Type
Method
Description
`abstract void`
`checkIntegrity()`
Checks consistency of this producer
`abstract BinaryDocValues`
`getBinary(FieldInfo field)`
Returns `BinaryDocValues` for this field.
`DocValuesProducer`
`getMergeInstance()`
Returns an instance optimized for merging.
`abstract NumericDocValues`
`getNumeric(FieldInfo field)`
Returns `NumericDocValues` for this field.
`abstract DocValuesSkipper`
`getSkipper(FieldInfo field)`
Returns a `DocValuesSkipper` for this field.
`abstract SortedDocValues`
`getSorted(FieldInfo field)`
Returns `SortedDocValues` for this field.
`abstract SortedNumericDocValues`
`getSortedNumeric(FieldInfo field)`
Returns `SortedNumericDocValues` for this field.
`abstract SortedSetDocValues`
`getSortedSet(FieldInfo field)`
Returns `SortedSetDocValues` for this field.

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

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

### Methods inherited from interface java.io.Closeable

`close`

## Constructor Details

### DocValuesProducer

protected DocValuesProducer()
Sole constructor. (For invocation by subclass constructors, typically implicit.)

## Method Details

### getNumeric

public abstract NumericDocValues getNumeric(FieldInfo field) throws IOException
Returns `NumericDocValues` for this field. The returned instance need not be thread-safe: it will only be used by a single thread. The behavior is undefined if the doc values type of the given field is not `DocValuesType.NUMERIC`. The return value is never `null`.

Throws:
  `IOException`

### getBinary

public abstract BinaryDocValues getBinary(FieldInfo field) throws IOException
Returns `BinaryDocValues` for this field. The returned instance need not be thread-safe: it will only be used by a single thread. The behavior is undefined if the doc values type of the given field is not `DocValuesType.BINARY`. The return value is never `null`.

Throws:
  `IOException`

### getSorted

public abstract SortedDocValues getSorted(FieldInfo field) throws IOException
Returns `SortedDocValues` for this field. The returned instance need not be thread-safe: it will only be used by a single thread. The behavior is undefined if the doc values type of the given field is not `DocValuesType.SORTED`. The return value is never `null`.

Throws:
  `IOException`

### getSortedNumeric

public abstract SortedNumericDocValues getSortedNumeric(FieldInfo field) throws IOException
Returns `SortedNumericDocValues` for this field. The returned instance need not be thread-safe: it will only be used by a single thread. The behavior is undefined if the doc values type of the given field is not `DocValuesType.SORTED_NUMERIC`. The return value is never `null`.

Throws:
  `IOException`

### getSortedSet

public abstract SortedSetDocValues getSortedSet(FieldInfo field) throws IOException
Returns `SortedSetDocValues` for this field. The returned instance need not be thread-safe: it will only be used by a single thread. The behavior is undefined if the doc values type of the given field is not `DocValuesType.SORTED_SET`. The return value is never `null`.

Throws:
  `IOException`

### getSkipper

public abstract DocValuesSkipper getSkipper(FieldInfo field) throws IOException
Returns a `DocValuesSkipper` for this field. The returned instance need not be thread-safe: it will only be used by a single thread. The return value is undefined if `FieldInfo.docValuesSkipIndexType()` returns `DocValuesSkipIndexType.NONE`.

Throws:
  `IOException`

### checkIntegrity

public abstract void checkIntegrity() throws IOException
Checks consistency of this producer

Note that this may be costly in terms of I/O, e.g. may involve computing a checksum value against large data files.

Throws:
  `IOException`
NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.

### getMergeInstance

public DocValuesProducer getMergeInstance()
Returns an instance optimized for merging. This instance may only be consumed in the thread that called `getMergeInstance()`.

The default implementation returns `this`