private class DocTermOrds.Iterator extends SortedSetDocValues
Modifier and Type | Field and Description |
---|---|
private byte[] |
arr |
(package private) int[] |
buffer |
(package private) int |
bufferLength |
(package private) int |
bufferUpto |
(package private) LeafReader |
reader |
(package private) TermsEnum |
te |
private int |
tnum |
private int |
upto |
NO_MORE_ORDS
Constructor and Description |
---|
Iterator(LeafReader reader) |
Modifier and Type | Method and Description |
---|---|
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) . |
(package private) int |
read(int[] buffer)
Buffer must be at least 5 ints long.
|
void |
setDocument(int docID)
Sets iteration to the specified docID
|
TermsEnum |
termsEnum()
Returns a
TermsEnum over the values. |
final LeafReader reader
final TermsEnum te
final int[] buffer
int bufferUpto
int bufferLength
private int tnum
private int upto
private byte[] arr
Iterator(LeafReader reader) throws java.io.IOException
java.io.IOException
public long nextOrd()
SortedSetDocValues
SortedSetDocValues.setDocument(int)
.nextOrd
in class SortedSetDocValues
SortedSetDocValues.NO_MORE_ORDS
.
ordinals are dense, start at 0, then increment by 1 for
the next value in sorted order.int read(int[] buffer)
public void setDocument(int docID)
SortedSetDocValues
setDocument
in class SortedSetDocValues
docID
- document IDpublic BytesRef lookupOrd(long ord)
SortedSetDocValues
BytesRef
may be re-used across calls to lookupOrd so make sure to
copy it
if you want to keep it
around.lookupOrd
in class SortedSetDocValues
ord
- ordinal to lookupSortedSetDocValues.nextOrd()
public long getValueCount()
SortedSetDocValues
getValueCount
in class SortedSetDocValues
public long lookupTerm(BytesRef key)
SortedSetDocValues
key
exists, returns its ordinal, else
returns -insertionPoint-1
, like Arrays.binarySearch
.lookupTerm
in class SortedSetDocValues
key
- Key to look uppublic TermsEnum termsEnum()
SortedSetDocValues
TermsEnum
over the values.
The enum supports TermsEnum.ord()
and TermsEnum.seekExact(long)
.termsEnum
in class SortedSetDocValues