public abstract static class DocValues.SortedSource extends DocValues.Source
DocValues.Source for byte[] values per document.
type| Modifier | Constructor and Description |
|---|---|
protected |
DocValues.SortedSource(DocValues.Type type,
Comparator<BytesRef> comparator)
Sole constructor.
|
| Modifier and Type | Method and Description |
|---|---|
DocValues.SortedSource |
asSortedSource()
If this
DocValues.Source is sorted this method will return an instance of
DocValues.SortedSource otherwise UOE |
abstract BytesRef |
getByOrd(int ord,
BytesRef result)
Returns value for specified ord.
|
BytesRef |
getBytes(int docID,
BytesRef bytesRef)
Returns a
BytesRef for the given document id or throws an
UnsupportedOperationException if this source doesn't support
byte[] values. |
Comparator<BytesRef> |
getComparator()
Returns the comparator used to order the BytesRefs.
|
abstract PackedInts.Reader |
getDocToOrd()
Returns the PackedInts.Reader impl that maps document to ord.
|
int |
getOrdByValue(BytesRef value,
BytesRef spare)
Lookup ord by value.
|
abstract int |
getValueCount()
Returns the number of unique values in this sorted source
|
boolean |
hasPackedDocToOrd()
Return true if it's safe to call
getDocToOrd(). |
abstract int |
ord(int docID)
Returns ord for specified docID.
|
protected DocValues.SortedSource(DocValues.Type type, Comparator<BytesRef> comparator)
public BytesRef getBytes(int docID, BytesRef bytesRef)
DocValues.SourceBytesRef for the given document id or throws an
UnsupportedOperationException if this source doesn't support
byte[] values.getBytes in class DocValues.Sourcepublic abstract int ord(int docID)
Comparator value.public abstract BytesRef getByOrd(int ord, BytesRef result)
public boolean hasPackedDocToOrd()
getDocToOrd().public abstract PackedInts.Reader getDocToOrd()
public Comparator<BytesRef> getComparator()
public int getOrdByValue(BytesRef value, BytesRef spare)
value - the value to look upspare - a spare BytesRef instance used to compare internal
values to the given value. Must not be null(-(ord)-1), defined as the ordinal of the first
element that is greater than the given value (the insertion
point). This guarantees that the return value will always be
>= 0 if the given value is found.public DocValues.SortedSource asSortedSource()
DocValues.SourceDocValues.Source is sorted this method will return an instance of
DocValues.SortedSource otherwise UOEasSortedSource in class DocValues.Sourcepublic abstract int getValueCount()
Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.