Package org.apache.lucene.search
Class QueryRescorer
- java.lang.Object
- 
- org.apache.lucene.search.Rescorer
- 
- org.apache.lucene.search.QueryRescorer
 
 
- 
- 
Constructor SummaryConstructors Constructor Description QueryRescorer(Query query)Sole constructor, passing the 2nd pass query to assign scores to the 1st pass hits.
 - 
Method SummaryAll Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract floatcombine(float firstPassScore, boolean secondPassMatches, float secondPassScore)Implement this in a subclass to combine the first pass and second pass scores.Explanationexplain(IndexSearcher searcher, Explanation firstPassExplanation, int docID)Explains how the score for the specified document was computed.TopDocsrescore(IndexSearcher searcher, TopDocs firstPassTopDocs, int topN)Rescore an initial first-passTopDocs.static TopDocsrescore(IndexSearcher searcher, TopDocs topDocs, Query query, double weight, int topN)Sugar API, calling {#rescore} using a simple linear combination of firstPassScore + weight * secondPassScore
 
- 
- 
- 
Constructor Detail- 
QueryRescorerpublic QueryRescorer(Query query) Sole constructor, passing the 2nd pass query to assign scores to the 1st pass hits.
 
- 
 - 
Method Detail- 
combineprotected abstract float combine(float firstPassScore, boolean secondPassMatches, float secondPassScore)Implement this in a subclass to combine the first pass and second pass scores. If secondPassMatches is false then the second pass query failed to match a hit from the first pass query, and you should ignore the secondPassScore.
 - 
rescorepublic TopDocs rescore(IndexSearcher searcher, TopDocs firstPassTopDocs, int topN) throws IOException Description copied from class:RescorerRescore an initial first-passTopDocs.- Specified by:
- rescorein class- Rescorer
- Parameters:
- searcher-- IndexSearcherused 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
 
 - 
explainpublic Explanation explain(IndexSearcher searcher, Explanation firstPassExplanation, int docID) throws IOException Description copied from class:RescorerExplains how the score for the specified document was computed.- Specified by:
- explainin class- Rescorer
- Throws:
- IOException
 
 - 
rescorepublic static TopDocs rescore(IndexSearcher searcher, TopDocs topDocs, Query query, double weight, int topN) throws IOException Sugar API, calling {#rescore} using a simple linear combination of firstPassScore + weight * secondPassScore- Throws:
- IOException
 
 
- 
 
-