Package org.apache.solr.ltr.interleaving
Class LTRInterleavingRescorer
- java.lang.Object
-
- org.apache.lucene.search.Rescorer
-
- org.apache.solr.ltr.LTRRescorer
-
- org.apache.solr.ltr.interleaving.LTRInterleavingRescorer
-
public class LTRInterleavingRescorer extends LTRRescorer
Implements the rescoring logic. The top documents returned by solr with their original scores, will be processed by aLTRScoringQuerythat will assign a new score to each document. The top documents will be resorted based on the new score.
-
-
Field Summary
-
Fields inherited from class org.apache.solr.ltr.LTRRescorer
scoreComparator
-
-
Constructor Summary
Constructors Constructor Description LTRInterleavingRescorer(Interleaving interleavingAlgorithm, LTRInterleavingScoringQuery[] rerankingQueries)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.lucene.search.Explanationexplain(org.apache.lucene.search.IndexSearcher searcher, org.apache.lucene.search.Explanation firstPassExplanation, int docID)org.apache.lucene.search.TopDocsrescore(org.apache.lucene.search.IndexSearcher searcher, org.apache.lucene.search.TopDocs firstPassTopDocs, int topN)rescores the documents:voidscoreFeatures(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)-
Methods inherited from class org.apache.solr.ltr.LTRRescorer
extractFeaturesInfo, getExplanation, getFirstPassDocsRanked, heapAdjust, heapify, logSingleHit, scoreFeatures, scoreSingleHit
-
-
-
-
Constructor Detail
-
LTRInterleavingRescorer
public LTRInterleavingRescorer(Interleaving interleavingAlgorithm, LTRInterleavingScoringQuery[] rerankingQueries)
-
-
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 IOExceptionrescores the documents:- Overrides:
rescorein classLTRRescorer- Parameters:
searcher- current IndexSearcherfirstPassTopDocs- 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:
explainin classLTRRescorer- Throws:
IOException
-
-