Uses of Class
org.apache.lucene.search.Sort
Package
Description
Code to maintain and access indices.
Code to search indices.
-
Uses of Sort in org.apache.lucene.index
Modifier and TypeFieldDescriptionprotected Sort
LiveIndexWriterConfig.indexSort
The sort order to use to write merged segments.Modifier 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.Modifier and TypeMethodDescriptionIndexWriterConfig.setIndexSort
(Sort sort) Set theSort
order to use for all (flushed and merged) segments.CheckIndex.testSort
(CodecReader reader, Sort sort, PrintStream infoStream, boolean failFast) Tests index sort order.static CodecReader
SortingCodecReader.wrap
(CodecReader reader, Sort sort) Return a sorted view ofreader
according to the order defined bysort
.ModifierConstructorDescriptionLeafMetaData
(int createdVersionMajor, Version minVersion, Sort sort) Expert: Sole constructor.SegmentInfo
(Directory dir, Version version, Version minVersion, String name, int maxDoc, boolean isCompoundFile, Codec codec, Map<String, String> diagnostics, byte[] id, Map<String, String> attributes, Sort indexSort) Construct a new complete SegmentInfo instance from input. -
Uses of Sort in org.apache.lucene.search
Modifier and TypeFieldDescriptionstatic final Sort
Sort.INDEXORDER
Represents sorting by index order.static final Sort
Sort.RELEVANCE
Represents sorting by computed relevance.Modifier and TypeMethodDescriptionSort.rewrite
(IndexSearcher searcher) Rewrites the SortFields in this Sort, returning a new Sort if any of the fields changes during their rewriting.Modifier and TypeMethodDescriptionstatic TopFieldCollector
Creates a newTopFieldCollector
from the given arguments.static TopFieldCollector
Creates a newTopFieldCollector
from the given arguments.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
.Search implementation with arbitrary sorting.Search implementation with arbitrary sorting, plus control over whether hit scores and max score should be computed.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.