public final class DocValues
extends java.lang.Object
Modifier | Constructor and Description |
---|---|
private |
DocValues() |
Modifier and Type | Method and Description |
---|---|
private static void |
checkField(LeafReader in,
java.lang.String field,
DocValuesType... expected) |
static BinaryDocValues |
emptyBinary()
An empty
BinaryDocValues which returns no documents |
static NumericDocValues |
emptyNumeric()
An empty NumericDocValues which returns no documents
|
static SortedDocValues |
emptySorted()
An empty SortedDocValues which returns
BytesRef.EMPTY_BYTES for every document |
static SortedNumericDocValues |
emptySortedNumeric(int maxDoc)
An empty SortedNumericDocValues which returns zero values for every document
|
static SortedSetDocValues |
emptySortedSet()
An empty SortedDocValues which returns
BytesRef.EMPTY_BYTES for every document |
static BinaryDocValues |
getBinary(LeafReader reader,
java.lang.String field)
Returns BinaryDocValues for the field, or
emptyBinary() if it has none. |
static NumericDocValues |
getNumeric(LeafReader reader,
java.lang.String field)
Returns NumericDocValues for the field, or
emptyNumeric() if it has none. |
static SortedDocValues |
getSorted(LeafReader reader,
java.lang.String field)
Returns SortedDocValues for the field, or
emptySorted() if it has none. |
static SortedNumericDocValues |
getSortedNumeric(LeafReader reader,
java.lang.String field)
Returns SortedNumericDocValues for the field, or
emptySortedNumeric(int) if it has none. |
static SortedSetDocValues |
getSortedSet(LeafReader reader,
java.lang.String field)
Returns SortedSetDocValues for the field, or
emptySortedSet() if it has none. |
static boolean |
isCacheable(LeafReaderContext ctx,
java.lang.String... fields)
Returns
true if the specified docvalues fields have not been updated |
static SortedNumericDocValues |
singleton(NumericDocValues dv)
Returns a multi-valued view over the provided NumericDocValues
|
static SortedSetDocValues |
singleton(SortedDocValues dv)
Returns a multi-valued view over the provided SortedDocValues
|
static NumericDocValues |
unwrapSingleton(SortedNumericDocValues dv)
Returns a single-valued view of the SortedNumericDocValues, if it was previously
wrapped with
singleton(NumericDocValues) , or null. |
static SortedDocValues |
unwrapSingleton(SortedSetDocValues dv)
Returns a single-valued view of the SortedSetDocValues, if it was previously
wrapped with
singleton(SortedDocValues) , or null. |
public static final BinaryDocValues emptyBinary()
BinaryDocValues
which returns no documentspublic static final NumericDocValues emptyNumeric()
public static final SortedDocValues emptySorted()
BytesRef.EMPTY_BYTES
for every documentpublic static final SortedNumericDocValues emptySortedNumeric(int maxDoc)
public static final SortedSetDocValues emptySortedSet()
BytesRef.EMPTY_BYTES
for every documentpublic static SortedSetDocValues singleton(SortedDocValues dv)
public static SortedDocValues unwrapSingleton(SortedSetDocValues dv)
singleton(SortedDocValues)
, or null.public static NumericDocValues unwrapSingleton(SortedNumericDocValues dv)
singleton(NumericDocValues)
, or null.public static SortedNumericDocValues singleton(NumericDocValues dv)
private static void checkField(LeafReader in, java.lang.String field, DocValuesType... expected)
public static NumericDocValues getNumeric(LeafReader reader, java.lang.String field) throws java.io.IOException
emptyNumeric()
if it has none.field
does not exist in this reader.java.lang.IllegalStateException
- if field
exists, but was not indexed with docvalues.java.lang.IllegalStateException
- if field
has docvalues, but the type is not DocValuesType.NUMERIC
.java.io.IOException
- if an I/O error occurs.public static BinaryDocValues getBinary(LeafReader reader, java.lang.String field) throws java.io.IOException
emptyBinary()
if it has none.field
does not exist in this reader.java.lang.IllegalStateException
- if field
exists, but was not indexed with docvalues.java.lang.IllegalStateException
- if field
has docvalues, but the type is not DocValuesType.BINARY
or DocValuesType.SORTED
.java.io.IOException
- if an I/O error occurs.public static SortedDocValues getSorted(LeafReader reader, java.lang.String field) throws java.io.IOException
emptySorted()
if it has none.field
does not exist in this reader.java.lang.IllegalStateException
- if field
exists, but was not indexed with docvalues.java.lang.IllegalStateException
- if field
has docvalues, but the type is not DocValuesType.SORTED
.java.io.IOException
- if an I/O error occurs.public static SortedNumericDocValues getSortedNumeric(LeafReader reader, java.lang.String field) throws java.io.IOException
emptySortedNumeric(int)
if it has none.field
does not exist in this reader.java.lang.IllegalStateException
- if field
exists, but was not indexed with docvalues.java.lang.IllegalStateException
- if field
has docvalues, but the type is not DocValuesType.SORTED_NUMERIC
or DocValuesType.NUMERIC
.java.io.IOException
- if an I/O error occurs.public static SortedSetDocValues getSortedSet(LeafReader reader, java.lang.String field) throws java.io.IOException
emptySortedSet()
if it has none.field
does not exist in this reader.java.lang.IllegalStateException
- if field
exists, but was not indexed with docvalues.java.lang.IllegalStateException
- if field
has docvalues, but the type is not DocValuesType.SORTED_SET
or DocValuesType.SORTED
.java.io.IOException
- if an I/O error occurs.public static boolean isCacheable(LeafReaderContext ctx, java.lang.String... fields)
true
if the specified docvalues fields have not been updated