public abstract class Sorter extends ObjectSorts documents of a given index by returning a permutation on the document IDs.
Sorterimplementation can be easily written from a
document comparatorby using the
sort(int, DocComparator)helper method. This is especially useful when documents are directly comparable by their field values.
Constructors Constructor Description
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description
getID()Returns the identifier of this
sort(AtomicReader reader)Returns a mapping from the old document ID to its new location in the sorted index.
public abstract Sorter.DocMap sort(AtomicReader reader) throws IOExceptionReturns a mapping from the old document ID to its new location in the sorted index. Implementations can use the auxiliary
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
readeris 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.
public abstract String getID()