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 |
|---|---|
static SortedDocValues |
EMPTY
An empty SortedDocValues which returns
BytesRef.EMPTY_BYTES for every document |
| Modifier | Constructor and Description |
|---|---|
protected |
SortedDocValues()
Sole constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
get(int docID,
BytesRef result)
Lookup the value for document.
|
abstract int |
getOrd(int docID)
Returns the ordinal for the specified docID.
|
abstract int |
getValueCount()
Returns the number of unique values.
|
abstract void |
lookupOrd(int ord,
BytesRef result)
Retrieves the value for the specified ordinal.
|
int |
lookupTerm(BytesRef key)
If
key exists, returns its ordinal, else
returns -insertionPoint-1, like Arrays.binarySearch. |
TermsEnum |
termsEnum()
Returns a
TermsEnum over the values. |
public static final SortedDocValues EMPTY
BytesRef.EMPTY_BYTES for every documentprotected SortedDocValues()
public abstract int getOrd(int docID)
docID - document ID to lookuppublic abstract void lookupOrd(int ord,
BytesRef result)
ord - ordinal to lookup (must be >= 0 and < getValueCount())result - will be populated with the ordinal's valuegetOrd(int)public abstract int getValueCount()
public void get(int docID,
BytesRef result)
BinaryDocValuesget in class BinaryDocValuespublic int lookupTerm(BytesRef key)
key exists, returns its ordinal, else
returns -insertionPoint-1, like Arrays.binarySearch.key - Key to look uppublic TermsEnum termsEnum()
TermsEnum over the values.
The enum supports TermsEnum.ord() and TermsEnum.seekExact(long).Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.