Package org.apache.solr.ltr
Class LTRRescorer
- java.lang.Object
- 
- org.apache.lucene.search.Rescorer
- 
- org.apache.solr.ltr.LTRRescorer
 
 
- 
 public class LTRRescorer extends org.apache.lucene.search.RescorerImplements 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.
- 
- 
Constructor SummaryConstructors Constructor Description LTRRescorer(LTRScoringQuery scoringQuery)
 - 
Method SummaryAll Methods Static 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)static LTRScoringQuery.FeatureInfo[]extractFeaturesInfo(LTRScoringQuery.ModelWeight modelWeight, int docid, Float originalDocScore, List<org.apache.lucene.index.LeafReaderContext> leafContexts)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, org.apache.lucene.search.TopDocs firstPassTopDocs, int topN, LTRScoringQuery.ModelWeight modelWeight, org.apache.lucene.search.ScoreDoc[] hits, List<org.apache.lucene.index.LeafReaderContext> leaves, org.apache.lucene.search.ScoreDoc[] reranked)
 
- 
- 
- 
Constructor Detail- 
LTRRescorerpublic LTRRescorer(LTRScoringQuery scoringQuery) 
 
- 
 - 
Method Detail- 
rescorepublic org.apache.lucene.search.TopDocs rescore(org.apache.lucene.search.IndexSearcher searcher, org.apache.lucene.search.TopDocs firstPassTopDocs, int topN) throws IOExceptionrescores the documents:- Specified by:
- rescorein class- org.apache.lucene.search.Rescorer
- Parameters:
- searcher- current IndexSearcher
- firstPassTopDocs- documents to rerank;
- topN- documents to return;
- Throws:
- IOException
 
 - 
scoreFeaturespublic void scoreFeatures(org.apache.lucene.search.IndexSearcher indexSearcher, org.apache.lucene.search.TopDocs firstPassTopDocs, int topN, LTRScoringQuery.ModelWeight modelWeight, org.apache.lucene.search.ScoreDoc[] hits, List<org.apache.lucene.index.LeafReaderContext> leaves, org.apache.lucene.search.ScoreDoc[] reranked) throws IOException- Throws:
- IOException
 
 - 
explainpublic org.apache.lucene.search.Explanation explain(org.apache.lucene.search.IndexSearcher searcher, org.apache.lucene.search.Explanation firstPassExplanation, int docID) throws IOException- Specified by:
- explainin class- org.apache.lucene.search.Rescorer
- Throws:
- IOException
 
 - 
extractFeaturesInfopublic static LTRScoringQuery.FeatureInfo[] extractFeaturesInfo(LTRScoringQuery.ModelWeight modelWeight, int docid, Float originalDocScore, List<org.apache.lucene.index.LeafReaderContext> leafContexts) throws IOException - Throws:
- IOException
 
 
- 
 
-