| Constructor and Description |
|---|
QueryRescorer(Query query)
Sole constructor, passing the 2nd pass query to
assign scores to the 1st pass hits.
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract float |
combine(float firstPassScore,
boolean secondPassMatches,
float secondPassScore)
Implement this in a subclass to combine the first pass and
second pass scores.
|
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. |
static TopDocs |
rescore(IndexSearcher searcher,
TopDocs topDocs,
Query query,
double weight,
int topN)
Sugar API, calling {#rescore} using a simple linear
combination of firstPassScore + weight * secondPassScore
|
public QueryRescorer(Query query)
protected abstract float combine(float firstPassScore,
boolean secondPassMatches,
float secondPassScore)
public TopDocs rescore(IndexSearcher searcher, TopDocs firstPassTopDocs, int topN) throws java.io.IOException
RescorerTopDocs.rescore in class Rescorersearcher - IndexSearcher used to produce the
first pass topDocsfirstPassTopDocs - 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 returnjava.io.IOExceptionpublic Explanation explain(IndexSearcher searcher, Explanation firstPassExplanation, int docID) throws java.io.IOException
Rescorerpublic static TopDocs rescore(IndexSearcher searcher, TopDocs topDocs, Query query, double weight, int topN) throws java.io.IOException
java.io.IOExceptionCopyright © 2000–2025 The Apache Software Foundation. All rights reserved.