|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.lucene.index.sorter.Sorter org.apache.lucene.index.sorter.NumericDocValuesSorter
public class NumericDocValuesSorter
A Sorter
which sorts documents according to their
NumericDocValues
. One can specify ascending or descending sort order.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.apache.lucene.index.sorter.Sorter |
---|
Sorter.DocComparator, Sorter.DocMap |
Field Summary |
---|
Fields inherited from class org.apache.lucene.index.sorter.Sorter |
---|
REVERSE_DOCS |
Constructor Summary | |
---|---|
NumericDocValuesSorter(String fieldName)
Constructor over the given field name, and ascending sort order. |
|
NumericDocValuesSorter(String fieldName,
boolean ascending)
Constructor over the given field name, and whether sorting should be ascending ( true ) or descending (false ). |
Method Summary | |
---|---|
String |
getID()
Returns the identifier of this Sorter . |
Sorter.DocMap |
sort(AtomicReader reader)
Returns a mapping from the old document ID to its new location in the sorted index. |
Methods inherited from class org.apache.lucene.index.sorter.Sorter |
---|
sort, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public NumericDocValuesSorter(String fieldName)
public NumericDocValuesSorter(String fieldName, boolean ascending)
true
) or descending (false
).
Method Detail |
---|
public Sorter.DocMap sort(AtomicReader reader) throws IOException
Sorter
Sorter.sort(int, DocComparator)
to compute the old-to-new permutation
given a list of documents and their corresponding values.
A return value of null is allowed and means that
reader
is already sorted.
NOTE: deleted documents are expected to appear in the mapping as well, they will however be marked as deleted in the sorted view.
sort
in class Sorter
IOException
public String getID()
Sorter
Sorter
.
This identifier is similar to Object.hashCode()
and should be
chosen so that two instances of this class that sort documents likewise
will have the same identifier. On the contrary, this identifier should be
different on different sorters
.
getID
in class Sorter
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |