## 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.

- - ### Uses of Sort in org.apache.lucene.index

    Fields in org.apache.lucene.index declared as Sort
    Modifier and Type | Field and Description
    --- | ---
    `protected Sort` | LiveIndexWriterConfig.`indexSort` The sort order to use to write merged segments.

    Methods in org.apache.lucene.index that return Sort
    Modifier and Type | Method and Description
    --- | ---
    `Sort` | LiveIndexWriterConfig.`getIndexSort()` Set the index-time `Sort` order.
    `abstract Sort` | LeafReader.`getIndexSort()` Returns null if this leaf is unsorted, or the `Sort` that it was sorted by
    `Sort` | FilterCodecReader.`getIndexSort()`
    `Sort` | FilterLeafReader.`getIndexSort()`
    `Sort` | SegmentReader.`getIndexSort()`
    `Sort` | SegmentInfo.`getIndexSort()` Return the sort order of this segment, or null if the index has no sort.
    `Sort` | ParallelLeafReader.`getIndexSort()`

    Methods in org.apache.lucene.index with parameters of type Sort
    Modifier and Type | Method and Description
    --- | ---
    `IndexWriterConfig` | IndexWriterConfig.`setIndexSort(Sort sort)` Set the `Sort` order to use when merging segments.
    `static CheckIndex.Status.IndexSortStatus` | CheckIndex.`testSort(CodecReader reader, Sort sort, PrintStream infoStream, boolean failFast)` Tests index sort order.

    Constructors in org.apache.lucene.index with parameters of type Sort
    Constructor and Description
    `SegmentInfo(Directory dir, Version version, 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

    Fields in org.apache.lucene.search declared as Sort
    Modifier and Type | Field and Description
    --- | ---
    `static Sort` | Sort.`INDEXORDER` Represents sorting by index order.
    `static Sort` | Sort.`RELEVANCE` Represents sorting by computed relevance.
    `protected Sort` | EarlyTerminatingSortingCollector.`sort` Sort used to sort the search results

    Methods in org.apache.lucene.search that return Sort
    Modifier and Type | Method and 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 and Description
    --- | ---
    `static boolean` | EarlyTerminatingSortingCollector.`canEarlyTerminate(Sort searchSort, Sort mergePolicySort)` Returns whether collection can be early-terminated if it sorts with the provided `Sort` and if segments are merged with the provided `Sort`.
    `static TopFieldCollector` | TopFieldCollector.`create(Sort sort, int numHits, boolean fillFields, boolean trackDocScores, boolean trackMaxScore)` Creates a new `TopFieldCollector` from the given arguments.
    `static TopFieldCollector` | TopFieldCollector.`create(Sort sort, int numHits, FieldDoc after, boolean fillFields, boolean trackDocScores, boolean trackMaxScore)` Creates a new `TopFieldCollector` from the given arguments.
    `static TopFieldDocs` | TopDocs.`merge(Sort sort, int start, int topN, TopFieldDocs[] shardHits, boolean setShardIndex)` Same as `TopDocs.merge(Sort, int, TopFieldDocs[])` but also ignores the top `start` 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 specified `Sort`.
    `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, boolean doMaxScore)` Search implementation with arbitrary sorting, plus control over whether hit scores and max score should be computed.
    `TopDocs` | IndexSearcher.`searchAfter(ScoreDoc after, Query query, int n, Sort sort)` Finds the top `n` hits for `query` where all results are after a previous result (`after`).
    `TopFieldDocs` | IndexSearcher.`searchAfter(ScoreDoc after, Query query, int numHits, Sort sort, boolean doDocScores, boolean doMaxScore)` Finds the top `n` hits for `query` 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 and Description
    `EarlyTerminatingSortingCollector(Collector in, Sort sort, int numDocsToCollect)` Create a new `EarlyTerminatingSortingCollector` instance.
    `SortRescorer(Sort sort)` Sole constructor.

Copyright © 2000-2018 Apache Software Foundation. All Rights Reserved.