public class SingletonSortedSetDocValues extends SortedSetDocValues
This can be used if you want to have one multi-valued implementation against e.g. FieldCache.getDocTermOrds that also works for single-valued fields.
EMPTY, NO_MORE_ORDS
Constructor and Description |
---|
SingletonSortedSetDocValues(SortedDocValues in)
Creates a multi-valued view over the provided SortedDocValues
|
Modifier and Type | Method and Description |
---|---|
long |
getValueCount()
Returns the number of unique values.
|
void |
lookupOrd(long ord,
BytesRef result)
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) . |
void |
setDocument(int docID)
Sets iteration to the specified docID
|
public SingletonSortedSetDocValues(SortedDocValues in)
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.public void setDocument(int docID)
SortedSetDocValues
setDocument
in class SortedSetDocValues
docID
- document IDpublic void lookupOrd(long ord, BytesRef result)
SortedSetDocValues
lookupOrd
in class SortedSetDocValues
ord
- ordinal to lookupresult
- will be populated with the ordinal's valueSortedSetDocValues.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 upCopyright © 2000-2013 Apache Software Foundation. All Rights Reserved.