Uses of Class
org.apache.lucene.search.Sort
Packages that use Sort
Package
Description
Code to maintain and access indices.
Code to search indices.
Grouping.
Analyzer based autosuggest.
-
Uses of Sort in org.apache.lucene.index
Fields in org.apache.lucene.index declared as SortModifier and TypeFieldDescriptionprotected Sort
LiveIndexWriterConfig.indexSort
The sort order to use to write merged segments.private final Sort
SegmentInfo.indexSort
private final Sort
LeafMetaData.sort
(package private) final Sort
Sorter.sort
Methods in org.apache.lucene.index that return SortModifier and TypeMethodDescriptionLiveIndexWriterConfig.getIndexSort()
Get the index-timeSort
order, applied to all (flushed and merged) segments.SegmentInfo.getIndexSort()
Return the sort order of this segment, or null if the index has no sort.LeafMetaData.getSort()
Return the order in which documents from this index are sorted, ornull
if documents are in no particular order.Methods in org.apache.lucene.index with parameters of type SortModifier and TypeMethodDescriptionprivate MergeState.DocMap[]
MergeState.buildDocMaps
(List<CodecReader> readers, Sort indexSort) (package private) static boolean
IndexWriter.isCongruentSort
(Sort indexSort, Sort otherSort) Returns true ifindexSort
is a prefix ofotherSort
.IndexWriterConfig.setIndexSort
(Sort sort) Set theSort
order to use for all (flushed and merged) segments.(package private) static MergeState.DocMap[]
MultiSorter.sort
(Sort sort, 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.CheckIndex.testSort
(CodecReader reader, Sort sort, PrintStream infoStream, boolean failFast) Tests index sort order.private void
IndexingChain.validateIndexSortDVType
(Sort indexSort, String fieldToValidate, DocValuesType dvType) static CodecReader
SortingCodecReader.wrap
(CodecReader reader, Sorter.DocMap docMap, Sort sort) Expert: same asSortingCodecReader.wrap(org.apache.lucene.index.CodecReader, Sort)
but operates directly on aSorter.DocMap
.static CodecReader
SortingCodecReader.wrap
(CodecReader reader, Sort sort) Return a sorted view ofreader
according to the order defined bysort
.Constructors in org.apache.lucene.index with parameters of type SortModifierConstructorDescriptionLeafMetaData
(int createdVersionMajor, Version minVersion, Sort sort, boolean hasBlocks) Expert: Sole constructor.SegmentInfo
(Directory dir, Version version, Version minVersion, String name, int maxDoc, boolean isCompoundFile, boolean hasBlocks, Codec codec, Map<String, String> diagnostics, byte[] id, Map<String, String> attributes, Sort indexSort) Construct a new complete SegmentInfo instance from input.(package private)
Creates a new Sorter to sort the index withsort
-
Uses of Sort in org.apache.lucene.search
Fields in org.apache.lucene.search declared as SortModifier and TypeFieldDescriptionstatic final Sort
Sort.INDEXORDER
Represents sorting by index order.static final Sort
Sort.RELEVANCE
Represents sorting by computed relevance.private final Sort
SortRescorer.sort
(package private) final Sort
TopFieldCollector.PagingFieldCollector.sort
(package private) final Sort
TopFieldCollector.SimpleFieldCollector.sort
Methods in org.apache.lucene.search that return SortModifier and TypeMethodDescriptionSort.rewrite
(IndexSearcher searcher) Rewrites the SortFields in this Sort, returning a new Sort if any of the fields changes during their rewriting.Methods in org.apache.lucene.search with parameters of type SortModifier and TypeMethodDescription(package private) static boolean
TopFieldCollector.canEarlyTerminate
(Sort searchSort, Sort indexSort) private static boolean
TopFieldCollector.canEarlyTerminateOnDocId
(Sort searchSort) private static boolean
TopFieldCollector.canEarlyTerminateOnPrefix
(Sort searchSort, Sort indexSort) static TopFieldCollector
Creates a newTopFieldCollector
from the given arguments.static TopFieldCollector
Creates a newTopFieldCollector
from the given arguments.(package private) static TopFieldCollector
TopFieldCollector.create
(Sort sort, int numHits, FieldDoc after, HitsThresholdChecker hitsThresholdChecker, MaxScoreAccumulator minScoreAcc) Same as above with additional parameters to allow passing in the threshold checker and the max score accumulator.TopFieldCollector.createSharedManager
(Sort sort, int numHits, FieldDoc after, int totalHitsThreshold) Create a CollectorManager which uses a shared hit counter to maintain number of hits and a sharedMaxScoreAccumulator
to propagate the minimum score accross segments if the primary sort is by relevancy.static TopFieldDocs
TopDocs.merge
(Sort sort, int start, int topN, TopFieldDocs[] shardHits) Same asTopDocs.merge(Sort, int, TopFieldDocs[])
but also ignores the topstart
top docs.static TopFieldDocs
TopDocs.merge
(Sort sort, int start, int topN, TopFieldDocs[] shardHits, Comparator<ScoreDoc> tieBreaker) Pass in a custom tie breaker for ordering resultsstatic TopFieldDocs
TopDocs.merge
(Sort sort, int topN, TopFieldDocs[] shardHits) Returns a new TopFieldDocs, containing topN results across the provided TopFieldDocs, sorting by the specifiedSort
.private static TopDocs
TopDocs.mergeAux
(Sort sort, int start, int size, TopDocs[] shardHits, Comparator<ScoreDoc> tieBreaker) Auxiliary method used by theTopDocs.merge(int, org.apache.lucene.search.TopDocs[])
impls.Search implementation with arbitrary sorting.Search implementation with arbitrary sorting, plus control over whether hit scores and max score should be computed.private TopFieldDocs
IndexSearcher.searchAfter
(FieldDoc after, Query query, int numHits, Sort sort, boolean doDocScores) IndexSearcher.searchAfter
(ScoreDoc after, Query query, int n, Sort sort) Finds the topn
hits forquery
where all results are after a previous result (after
).IndexSearcher.searchAfter
(ScoreDoc after, Query query, int numHits, Sort sort, boolean doDocScores) Finds the topn
hits forquery
where all results are after a previous result (after
), allowing control over whether hit scores and max score should be computed.Constructors in org.apache.lucene.search with parameters of type SortModifierConstructorDescriptionMergeSortQueue
(Sort sort, TopDocs[] shardHits, Comparator<ScoreDoc> tieBreaker) PagingFieldCollector
(Sort sort, FieldValueHitQueue<FieldValueHitQueue.Entry> queue, FieldDoc after, int numHits, HitsThresholdChecker hitsThresholdChecker, MaxScoreAccumulator minScoreAcc) SimpleFieldCollector
(Sort sort, FieldValueHitQueue<FieldValueHitQueue.Entry> queue, int numHits, HitsThresholdChecker hitsThresholdChecker, MaxScoreAccumulator minScoreAcc) SortRescorer
(Sort sort) Sole constructor.(package private)
TopFieldLeafCollector
(FieldValueHitQueue<FieldValueHitQueue.Entry> queue, Sort sort, LeafReaderContext context) -
Uses of Sort in org.apache.lucene.search.grouping
Fields in org.apache.lucene.search.grouping declared as SortModifier and TypeFieldDescriptionprivate final Sort
BlockGroupingCollector.groupSort
private Sort
GroupingSearch.groupSort
private final Sort
TopGroupsCollector.groupSort
protected final Sort
AllGroupHeadsCollector.sort
private Sort
GroupingSearch.sortWithinGroup
private final Sort
TopGroupsCollector.withinGroupSort
Methods in org.apache.lucene.search.grouping with parameters of type SortModifier and TypeMethodDescriptionTopGroups
<?> BlockGroupingCollector.getTopGroups
(Sort withinGroupSort, int groupOffset, int withinGroupOffset, int maxDocsPerGroup) Returns the grouped results.static <T> Collection
<SearchGroup<T>> SearchGroup.merge
(List<Collection<SearchGroup<T>>> topGroups, int offset, int topN, Sort groupSort) Merges multiple collections of top groups, for example obtained from separate index shards.static <T> TopGroups
<T> TopGroups.merge
(TopGroups<T>[] shardGroups, Sort groupSort, Sort docSort, int docOffset, int docTopN, TopGroups.ScoreMergeMode scoreMergeMode) Merges an array of TopGroups, for example obtained from the second-pass collector across multiple shards.static <T> AllGroupHeadsCollector
<T> AllGroupHeadsCollector.newCollector
(GroupSelector<T> selector, Sort sort) Create a new AllGroupHeadsCollector based on the type of within-group Sort requiredGroupingSearch.setGroupSort
(Sort groupSort) Specifies how groups are sorted.GroupingSearch.setSortWithinGroup
(Sort sortWithinGroup) Specified how documents inside a group are sorted.Constructors in org.apache.lucene.search.grouping with parameters of type SortModifierConstructorDescriptionprivate
AllGroupHeadsCollector
(GroupSelector<T> selector, Sort sort) BlockGroupingCollector
(Sort groupSort, int topNGroups, boolean needsScores, Weight lastDocPerGroup) Create the single pass collector.FirstPassGroupingCollector
(GroupSelector<T> groupSelector, Sort groupSort, int topNGroups) Create the first pass collector.GroupComparator
(Sort groupSort) GroupMerger
(Sort groupSort) protected
ScoringGroupHeadsCollector
(GroupSelector<T> selector, Sort sort) protected
SortingGroupHead
(Sort sort, T groupValue, int doc, LeafReaderContext context, Scorable scorer) protected
SortingGroupHeadsCollector
(GroupSelector<T> selector, Sort sort) (package private)
TopDocsReducer
(Sort withinGroupSort, int maxDocsPerGroup, boolean getMaxScores) TopGroupsCollector
(GroupSelector<T> groupSelector, Collection<SearchGroup<T>> groups, Sort groupSort, Sort withinGroupSort, int maxDocsPerGroup, boolean getMaxScores) Create a new TopGroupsCollector -
Uses of Sort in org.apache.lucene.search.suggest.analyzing
Fields in org.apache.lucene.search.suggest.analyzing declared as Sort