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.
Modifier and Type | Field and Description |
---|---|
private BytesRef |
empty |
NO_MORE_DOCS
Modifier | Constructor and Description |
---|---|
protected |
SortedDocValues()
Sole constructor.
|
Modifier and Type | Method and Description |
---|---|
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. |
advanceExact
advance, all, cost, docID, empty, nextDoc, range, slowAdvance
private final BytesRef empty
protected SortedDocValues()
public abstract int ordValue() throws java.io.IOException
DocValuesIterator.advanceExact(int)
returned false
.java.io.IOException
public 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.IOException
ordValue()
public BytesRef binaryValue() throws java.io.IOException
BinaryDocValues
DocValuesIterator.advanceExact(int)
returned false
.binaryValue
in class BinaryDocValues
java.io.IOException
public 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.IOException
public TermsEnum termsEnum() throws java.io.IOException
TermsEnum
over the values.
The enum supports TermsEnum.ord()
and TermsEnum.seekExact(long)
.java.io.IOException
public TermsEnum intersect(CompiledAutomaton automaton) throws java.io.IOException
TermsEnum
over the values, filtered by a CompiledAutomaton
The enum supports TermsEnum.ord()
.java.io.IOException