final class SingletonSortedSetDocValues extends RandomAccessOrds
This can be used if you want to have one multi-valued implementation that works for single or multi-valued types.
| Modifier and Type | Field and Description |
|---|---|
private long |
currentOrd |
private SortedDocValues |
in |
private long |
ord |
NO_MORE_ORDS| Constructor and Description |
|---|
SingletonSortedSetDocValues(SortedDocValues in)
Creates a multi-valued view over the provided SortedDocValues
|
| Modifier and Type | Method and Description |
|---|---|
int |
cardinality()
Returns the cardinality for the current document (previously
set by
SortedSetDocValues.setDocument(int). |
SortedDocValues |
getSortedDocValues()
Return the wrapped
SortedDocValues |
long |
getValueCount()
Returns the number of unique values.
|
BytesRef |
lookupOrd(long ord)
Retrieves the value for the specified ordinal.
|
long |
lookupTerm(BytesRef key)
If
key exists, returns its ordinal, else
returns -insertionPoint-1, like Arrays.binarySearch. |
long |
nextOrd()
Returns the next ordinal for the current document (previously
set by
SortedSetDocValues.setDocument(int). |
long |
ordAt(int index)
Retrieve the ordinal for the current document (previously
set by
SortedSetDocValues.setDocument(int) at the specified index. |
void |
setDocument(int docID)
Sets iteration to the specified docID
|
TermsEnum |
termsEnum()
Returns a
TermsEnum over the values. |
private final SortedDocValues in
private long currentOrd
private long ord
public SingletonSortedSetDocValues(SortedDocValues in)
public SortedDocValues getSortedDocValues()
SortedDocValuespublic long nextOrd()
SortedSetDocValuesSortedSetDocValues.setDocument(int).nextOrd in class SortedSetDocValuesSortedSetDocValues.NO_MORE_ORDS.
ordinals are dense, start at 0, then increment by 1 for
the next value in sorted order.public void setDocument(int docID)
SortedSetDocValuessetDocument in class SortedSetDocValuesdocID - document IDpublic BytesRef lookupOrd(long ord)
SortedSetDocValuesBytesRef may be re-used across calls to lookupOrd so make sure to
copy it if you want to keep it
around.lookupOrd in class SortedSetDocValuesord - ordinal to lookupSortedSetDocValues.nextOrd()public long getValueCount()
SortedSetDocValuesgetValueCount in class SortedSetDocValuespublic long lookupTerm(BytesRef key)
SortedSetDocValueskey exists, returns its ordinal, else
returns -insertionPoint-1, like Arrays.binarySearch.lookupTerm in class SortedSetDocValueskey - Key to look uppublic long ordAt(int index)
RandomAccessOrdsSortedSetDocValues.setDocument(int) at the specified index.
An index ranges from 0 to cardinality()-1.
The first ordinal value is at index 0, the next at index 1,
and so on, as for array indexing.
ordAt in class RandomAccessOrdsindex - index of the ordinal for the document.public int cardinality()
RandomAccessOrdsSortedSetDocValues.setDocument(int).cardinality in class RandomAccessOrdspublic TermsEnum termsEnum()
SortedSetDocValuesTermsEnum over the values.
The enum supports TermsEnum.ord() and TermsEnum.seekExact(long).termsEnum in class SortedSetDocValues