Uses of Class
org.apache.lucene.search.Sort
-
Packages that use Sort Package Description org.apache.lucene.index Code to maintain and access indices.org.apache.lucene.search Code to search indices.org.apache.lucene.search.grouping Grouping.org.apache.lucene.search.suggest.analyzing Analyzer based autosuggest. -
-
Uses of Sort in org.apache.lucene.index
Fields in org.apache.lucene.index declared as Sort Modifier and Type Field Description protected Sort
LiveIndexWriterConfig. indexSort
The sort order to use to write merged segments.private Sort
SegmentInfo. indexSort
private Sort
LeafMetaData. sort
(package private) Sort
Sorter. sort
Methods in org.apache.lucene.index that return Sort Modifier and Type Method Description Sort
LiveIndexWriterConfig. getIndexSort()
Get the index-timeSort
order, applied to all (flushed and merged) segments.Sort
SegmentInfo. getIndexSort()
Return the sort order of this segment, or null if the index has no sort.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 Sort Modifier and Type Method Description private MergeState.DocMap[]
MergeState. buildDocMaps(java.util.List<CodecReader> readers, Sort indexSort)
(package private) static boolean
IndexWriter. isCongruentSort(Sort indexSort, Sort otherSort)
Returns true ifindexSort
is a prefix ofotherSort
.IndexWriterConfig
IndexWriterConfig. setIndexSort(Sort sort)
Set theSort
order to use for all (flushed and merged) segments.(package private) static MergeState.DocMap[]
MultiSorter. 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.static CheckIndex.Status.IndexSortStatus
CheckIndex. testSort(CodecReader reader, Sort sort, java.io.PrintStream infoStream, boolean failFast)
Tests index sort order.private void
DefaultIndexingChain. validateIndexSortDVType(Sort indexSort, java.lang.String fieldName, DocValuesType dvType)
static LeafReader
SortingLeafReader. wrap(LeafReader reader, Sort sort)
Return a sorted view ofreader
according to the order defined bysort
.Constructors in org.apache.lucene.index with parameters of type Sort Constructor Description LeafMetaData(int createdVersionMajor, Version minVersion, Sort sort)
Expert: Sole constructor.SegmentInfo(Directory dir, Version version, Version minVersion, java.lang.String name, int maxDoc, boolean isCompoundFile, Codec codec, java.util.Map<java.lang.String,java.lang.String> diagnostics, byte[] id, java.util.Map<java.lang.String,java.lang.String> attributes, Sort indexSort)
Construct a new complete SegmentInfo instance from input.Sorter(Sort sort)
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 Sort Modifier and Type Field Description static Sort
Sort. INDEXORDER
Represents sorting by index order.static Sort
Sort. RELEVANCE
Represents sorting by computed relevance.private Sort
SortRescorer. sort
(package private) Sort
TopFieldCollector.PagingFieldCollector. sort
(package private) Sort
TopFieldCollector.SimpleFieldCollector. sort
Methods in org.apache.lucene.search that return Sort Modifier and Type Method Description Sort
Sort. 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 Sort Modifier and Type Method Description (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
TopFieldCollector. create(Sort sort, int numHits, int totalHitsThreshold)
Creates a newTopFieldCollector
from the given arguments.static TopFieldCollector
TopFieldCollector. create(Sort sort, int numHits, FieldDoc after, int totalHitsThreshold)
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.static CollectorManager<TopFieldCollector,TopFieldDocs>
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, boolean setShardIndex)
Same asTopDocs.merge(Sort, int, TopFieldDocs[])
but also ignores the topstart
top docs.static 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, boolean setShardIndex)
Auxiliary method used by theTopDocs.merge(int, org.apache.lucene.search.TopDocs[])
impls.TopFieldDocs
IndexSearcher. search(Query query, int n, Sort sort)
Search implementation with arbitrary sorting.TopFieldDocs
IndexSearcher. search(Query query, int n, Sort sort, boolean doDocScores)
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)
TopDocs
IndexSearcher. searchAfter(ScoreDoc after, Query query, int n, Sort sort)
Finds the topn
hits forquery
where all results are after a previous result (after
).TopFieldDocs
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 Sort Constructor Description MergeSortQueue(Sort sort, TopDocs[] shardHits)
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. -
Uses of Sort in org.apache.lucene.search.grouping
Fields in org.apache.lucene.search.grouping declared as Sort Modifier and Type Field Description private Sort
BlockGroupingCollector. groupSort
private Sort
GroupingSearch. groupSort
private Sort
TopGroupsCollector. groupSort
protected Sort
AllGroupHeadsCollector. sort
private Sort
GroupingSearch. sortWithinGroup
private Sort
TopGroupsCollector. withinGroupSort
Methods in org.apache.lucene.search.grouping with parameters of type Sort Modifier and Type Method Description TopGroups<?>
BlockGroupingCollector. getTopGroups(Sort withinGroupSort, int groupOffset, int withinGroupOffset, int maxDocsPerGroup)
Returns the grouped results.static <T> java.util.Collection<SearchGroup<T>>
SearchGroup. merge(java.util.List<java.util.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
GroupingSearch. setGroupSort(Sort groupSort)
Specifies how groups are sorted.GroupingSearch
GroupingSearch. setSortWithinGroup(Sort sortWithinGroup)
Specified how documents inside a group are sorted.Constructors in org.apache.lucene.search.grouping with parameters of type Sort Constructor Description 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)
ScoringGroupHeadsCollector(GroupSelector<T> selector, Sort sort)
SortingGroupHead(Sort sort, T groupValue, int doc, LeafReaderContext context, Scorable scorer)
SortingGroupHeadsCollector(GroupSelector<T> selector, Sort sort)
TopDocsReducer(Sort withinGroupSort, int maxDocsPerGroup, boolean getMaxScores)
TopGroupsCollector(GroupSelector<T> groupSelector, java.util.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 Modifier and Type Field Description private static Sort
AnalyzingInfixSuggester. SORT
How we sort the postings and search results.
-