public abstract class SortedDocValues extends BinaryDocValues
Per-Document values in a SortedDocValues are deduplicated, dereferenced, and sorted into a dictionary of unique values. A pointer to the dictionary value (ordinal) can be retrieved for each document. Ordinals are dense and in increasing sorted order.
NO_MORE_DOCS| Modifier | Constructor and Description |
|---|---|
protected |
SortedDocValues()
Sole constructor.
|
| Modifier and Type | Method and Description |
|---|---|
abstract boolean |
advanceExact(int target)
Advance the iterator to exactly
target and return whether
target has a value. |
BytesRef |
binaryValue()
Returns the binary value for the current document ID.
|
abstract int |
getValueCount()
Returns the number of unique values.
|
TermsEnum |
intersect(CompiledAutomaton automaton)
Returns a
TermsEnum over the values, filtered by a CompiledAutomaton
The enum supports TermsEnum.ord(). |
abstract BytesRef |
lookupOrd(int ord)
Retrieves the value for the specified ordinal.
|
int |
lookupTerm(BytesRef key)
If
key exists, returns its ordinal, else
returns -insertionPoint-1, like Arrays.binarySearch. |
abstract int |
ordValue()
Returns the ordinal for the current docID.
|
TermsEnum |
termsEnum()
Returns a
TermsEnum over the values. |
advance, all, cost, docID, empty, nextDoc, range, slowAdvanceprotected SortedDocValues()
public abstract int ordValue()
throws java.io.IOException
advanceExact(int)
returned false.java.io.IOExceptionpublic abstract BytesRef lookupOrd(int ord) throws java.io.IOException
BytesRef may be re-used across calls to lookupOrd(int)
so make sure to copy it if you want
to keep it around.ord - ordinal to lookup (must be >= 0 and < getValueCount())java.io.IOExceptionordValue()public BytesRef binaryValue() throws java.io.IOException
BinaryDocValuesadvanceExact(int)
returned false.binaryValue in class BinaryDocValuesjava.io.IOExceptionpublic abstract int getValueCount()
public int lookupTerm(BytesRef key) throws java.io.IOException
key exists, returns its ordinal, else
returns -insertionPoint-1, like Arrays.binarySearch.key - Key to look upjava.io.IOExceptionpublic TermsEnum termsEnum() throws java.io.IOException
TermsEnum over the values.
The enum supports TermsEnum.ord() and TermsEnum.seekExact(long).java.io.IOExceptionpublic TermsEnum intersect(CompiledAutomaton automaton) throws java.io.IOException
TermsEnum over the values, filtered by a CompiledAutomaton
The enum supports TermsEnum.ord().java.io.IOExceptionpublic abstract boolean advanceExact(int target)
throws java.io.IOException
target and return whether
target has a value.
target must be greater than or equal to the current
doc ID and must be a valid doc ID, ie. ≥ 0 and
< maxDoc.
After this method returns, DocIdSetIterator.docID() retuns target.java.io.IOExceptionCopyright © 2000–2025 The Apache Software Foundation. All rights reserved.