Package org.apache.lucene.index
Class DocValues
java.lang.Object
org.apache.lucene.index.DocValues
This class contains utility methods and constants for DocValues
-
Method Summary
Modifier and TypeMethodDescriptionstatic final BinaryDocValues
An emptyBinaryDocValues
which returns no documentsstatic final NumericDocValues
An empty NumericDocValues which returns no documentsstatic final SortedDocValues
An empty SortedDocValues which returnsBytesRef.EMPTY_BYTES
for every documentstatic final SortedNumericDocValues
An empty SortedNumericDocValues which returns zero values for every documentstatic final SortedSetDocValues
An empty SortedDocValues which returnsBytesRef.EMPTY_BYTES
for every documentstatic BinaryDocValues
getBinary
(LeafReader reader, String field) Returns BinaryDocValues for the field, oremptyBinary()
if it has none.static NumericDocValues
getNumeric
(LeafReader reader, String field) Returns NumericDocValues for the field, oremptyNumeric()
if it has none.static SortedDocValues
getSorted
(LeafReader reader, String field) Returns SortedDocValues for the field, oremptySorted()
if it has none.static SortedNumericDocValues
getSortedNumeric
(LeafReader reader, String field) Returns SortedNumericDocValues for the field, oremptySortedNumeric()
if it has none.static SortedSetDocValues
getSortedSet
(LeafReader reader, String field) Returns SortedSetDocValues for the field, oremptySortedSet()
if it has none.static boolean
isCacheable
(LeafReaderContext ctx, String... fields) Returnstrue
if the specified docvalues fields have not been updatedstatic SortedNumericDocValues
Returns a multi-valued view over the provided NumericDocValuesstatic SortedSetDocValues
Returns a multi-valued view over the provided SortedDocValuesstatic NumericDocValues
Returns a single-valued view of the SortedNumericDocValues, if it was previously wrapped withsingleton(NumericDocValues)
, or null.static SortedDocValues
Returns a single-valued view of the SortedSetDocValues, if it was previously wrapped withsingleton(SortedDocValues)
, or null.
-
Method Details
-
emptyBinary
An emptyBinaryDocValues
which returns no documents -
emptyNumeric
An empty NumericDocValues which returns no documents -
emptySorted
An empty SortedDocValues which returnsBytesRef.EMPTY_BYTES
for every document -
emptySortedNumeric
An empty SortedNumericDocValues which returns zero values for every document -
emptySortedSet
An empty SortedDocValues which returnsBytesRef.EMPTY_BYTES
for every document -
singleton
Returns a multi-valued view over the provided SortedDocValues -
unwrapSingleton
Returns a single-valued view of the SortedSetDocValues, if it was previously wrapped withsingleton(SortedDocValues)
, or null. -
unwrapSingleton
Returns a single-valued view of the SortedNumericDocValues, if it was previously wrapped withsingleton(NumericDocValues)
, or null. -
singleton
Returns a multi-valued view over the provided NumericDocValues -
getNumeric
Returns NumericDocValues for the field, oremptyNumeric()
if it has none.- Returns:
- docvalues instance, or an empty instance if
field
does not exist in this reader. - Throws:
IllegalStateException
- iffield
exists, but was not indexed with docvalues.IllegalStateException
- iffield
has docvalues, but the type is notDocValuesType.NUMERIC
.IOException
- if an I/O error occurs.
-
getBinary
Returns BinaryDocValues for the field, oremptyBinary()
if it has none.- Returns:
- docvalues instance, or an empty instance if
field
does not exist in this reader. - Throws:
IllegalStateException
- iffield
exists, but was not indexed with docvalues.IllegalStateException
- iffield
has docvalues, but the type is notDocValuesType.BINARY
.IOException
- if an I/O error occurs.
-
getSorted
Returns SortedDocValues for the field, oremptySorted()
if it has none.- Returns:
- docvalues instance, or an empty instance if
field
does not exist in this reader. - Throws:
IllegalStateException
- iffield
exists, but was not indexed with docvalues.IllegalStateException
- iffield
has docvalues, but the type is notDocValuesType.SORTED
.IOException
- if an I/O error occurs.
-
getSortedNumeric
public static SortedNumericDocValues getSortedNumeric(LeafReader reader, String field) throws IOException Returns SortedNumericDocValues for the field, oremptySortedNumeric()
if it has none.- Returns:
- docvalues instance, or an empty instance if
field
does not exist in this reader. - Throws:
IllegalStateException
- iffield
exists, but was not indexed with docvalues.IllegalStateException
- iffield
has docvalues, but the type is notDocValuesType.SORTED_NUMERIC
orDocValuesType.NUMERIC
.IOException
- if an I/O error occurs.
-
getSortedSet
Returns SortedSetDocValues for the field, oremptySortedSet()
if it has none.- Returns:
- docvalues instance, or an empty instance if
field
does not exist in this reader. - Throws:
IllegalStateException
- iffield
exists, but was not indexed with docvalues.IllegalStateException
- iffield
has docvalues, but the type is notDocValuesType.SORTED_SET
orDocValuesType.SORTED
.IOException
- if an I/O error occurs.
-
isCacheable
Returnstrue
if the specified docvalues fields have not been updated
-