Class LTRInterleavingRescorer


  • public class LTRInterleavingRescorer
    extends LTRRescorer
    Implements the rescoring logic. The top documents returned by solr with their original scores, will be processed by a LTRScoringQuery that will assign a new score to each document. The top documents will be resorted based on the new score.
    • Method Detail

      • rescore

        public org.apache.lucene.search.TopDocs rescore​(org.apache.lucene.search.IndexSearcher searcher,
                                                        org.apache.lucene.search.TopDocs firstPassTopDocs,
                                                        int topN)
                                                 throws IOException
        rescores the documents:
        Overrides:
        rescore in class LTRRescorer
        Parameters:
        searcher - current IndexSearcher
        firstPassTopDocs - documents to rerank;
        topN - documents to return;
        Throws:
        IOException
      • scoreFeatures

        public void scoreFeatures​(org.apache.lucene.search.IndexSearcher indexSearcher,
                                  int topN,
                                  LTRScoringQuery.ModelWeight[] modelWeights,
                                  org.apache.lucene.search.ScoreDoc[] hits,
                                  List<org.apache.lucene.index.LeafReaderContext> leaves,
                                  org.apache.lucene.search.ScoreDoc[][] rerankedPerModel)
                           throws IOException
        Throws:
        IOException
      • explain

        public org.apache.lucene.search.Explanation explain​(org.apache.lucene.search.IndexSearcher searcher,
                                                            org.apache.lucene.search.Explanation firstPassExplanation,
                                                            int docID)
                                                     throws IOException
        Overrides:
        explain in class LTRRescorer
        Throws:
        IOException