final class Sorter
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
(package private) static class |
Sorter.DocComparator
A comparator of doc IDs.
|
(package private) static class |
Sorter.DocMap
A permutation of doc IDs.
|
private static class |
Sorter.DocValueSorter |
Modifier and Type | Field and Description |
---|---|
(package private) static Scorer |
FAKESCORER |
(package private) Sort |
sort |
Constructor and Description |
---|
Sorter(Sort sort)
Creates a new Sorter to sort the index with
sort |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getID()
Returns the identifier of this
Sorter . |
(package private) static boolean |
isConsistent(Sorter.DocMap docMap)
Check consistency of a
Sorter.DocMap , useful for assertions. |
private static Sorter.DocMap |
sort(int maxDoc,
Sorter.DocComparator comparator)
Computes the old-to-new permutation over the given comparator.
|
(package private) Sorter.DocMap |
sort(LeafReader reader)
Returns a mapping from the old document ID to its new location in the
sorted index.
|
java.lang.String |
toString() |
Sorter(Sort sort)
sort
static boolean isConsistent(Sorter.DocMap docMap)
Sorter.DocMap
, useful for assertions.private static Sorter.DocMap sort(int maxDoc, Sorter.DocComparator comparator)
Sorter.DocMap sort(LeafReader reader) throws java.io.IOException
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.
java.io.IOException
public java.lang.String getID()
public java.lang.String toString()
toString
in class java.lang.Object