Package org.apache.lucene.index
Class MultiSorter
- java.lang.Object
-
- org.apache.lucene.index.MultiSorter
-
final class MultiSorter extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static interface
MultiSorter.ComparableProvider
Returns a long so that the natural ordering of long values matches the ordering of doc IDs for the given comparator.private static class
MultiSorter.LeafAndDocID
-
Constructor Summary
Constructors Constructor Description MultiSorter()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static MultiSorter.ComparableProvider[]
getComparableProviders(java.util.List<CodecReader> readers, SortField sortField)
ReturnsComparableProvider
s for the provided readers to represent the requestedSortField
sort order.(package private) static MergeState.DocMap[]
sort(Sort sort, java.util.List<CodecReader> readers)
Does a merge sort of the leaves of the incoming reader, returningMergeState.DocMap
to map each leaf's documents into the merged segment.
-
-
-
Method Detail
-
sort
static MergeState.DocMap[] sort(Sort sort, java.util.List<CodecReader> readers) throws java.io.IOException
Does a merge sort of the leaves of the incoming reader, returningMergeState.DocMap
to map each leaf's documents into the merged segment. The documents for each incoming leaf reader must already be sorted by the same sort! Returns null if the merge sort is not needed (segments are already in index sort order).- Throws:
java.io.IOException
-
getComparableProviders
private static MultiSorter.ComparableProvider[] getComparableProviders(java.util.List<CodecReader> readers, SortField sortField) throws java.io.IOException
ReturnsComparableProvider
s for the provided readers to represent the requestedSortField
sort order.- Throws:
java.io.IOException
-
-