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 | Constructor and Description |
|---|---|
protected |
SortedDocValues()
Sole constructor.
|
| Modifier and Type | Method and Description |
|---|---|
BytesRef |
get(int docID)
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 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. |
TermsEnum |
termsEnum()
Returns a
TermsEnum over the values. |
protected SortedDocValues()
public abstract int getOrd(int docID)
docID - document ID to lookuppublic abstract BytesRef lookupOrd(int ord)
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())getOrd(int)public abstract int getValueCount()
public BytesRef get(int docID)
BinaryDocValuesBytesRef may be
re-used across calls to BinaryDocValues.get(int) so make sure to
copy it if you want to keep it
around.get 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-2016 Apache Software Foundation. All Rights Reserved.