org.apache.lucene.search

## Class SortRescorer

- java.lang.Object
- - org.apache.lucene.search.Rescorer
  - - org.apache.lucene.search.SortRescorer

-     public class SortRescorer
      extends Rescorer

  A `Rescorer` that re-sorts according to a provided Sort.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SortRescorer(Sort sort)` Sole constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Explanation` | `explain(IndexSearcher searcher, Explanation firstPassExplanation, int docID)` Explains how the score for the specified document was computed.
    `TopDocs` | `rescore(IndexSearcher searcher, TopDocs firstPassTopDocs, int topN)` Rescore an initial first-pass `TopDocs`.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### SortRescorer

          public SortRescorer(Sort sort)

      Sole constructor.

  - ### Method Detail

    - #### rescore

          public TopDocs rescore(IndexSearcher searcher,
                                 TopDocs firstPassTopDocs,
                                 int topN)
                          throws IOException

      Description copied from class: `Rescorer`
      Rescore an initial first-pass `TopDocs`.
      Specified by:
        `rescore` in class `Rescorer`
      Parameters:
        `searcher` - `IndexSearcher` used to produce the first pass topDocs
        `firstPassTopDocs` - Hits from the first pass search. It's very important that these hits were produced by the provided searcher; otherwise the doc IDs will not match!
        `topN` - How many re-scored hits to return
      Throws:
        `IOException`

    - #### explain

          public Explanation explain(IndexSearcher searcher,
                                     Explanation firstPassExplanation,
                                     int docID)
                              throws IOException

      Description copied from class: `Rescorer`
      Explains how the score for the specified document was computed.
      Specified by:
        `explain` in class `Rescorer`
      Throws:
        `IOException`

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