Class QueryRescorer
A Rescorer that uses a provided Query to assign scores to the first-pass hits.
Note
This API is experimental and might change in incompatible ways in the next release.
Inherited Members
Namespace: Lucene.Net.Search
Assembly: Lucene.Net.dll
Syntax
public abstract class QueryRescorer : Rescorer
Constructors
QueryRescorer(Query)
Sole constructor, passing the 2nd pass query to assign scores to the 1st pass hits.
Declaration
protected QueryRescorer(Query query)
Parameters
Type | Name | Description |
---|---|---|
Query | query |
Methods
Combine(float, bool, float)
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
.
Declaration
protected abstract float Combine(float firstPassScore, bool secondPassMatches, float secondPassScore)
Parameters
Type | Name | Description |
---|---|---|
float | firstPassScore | |
bool | secondPassMatches | |
float | secondPassScore |
Returns
Type | Description |
---|---|
float |
Explain(IndexSearcher, Explanation, int)
Explains how the score for the specified document was computed.
Declaration
public override Explanation Explain(IndexSearcher searcher, Explanation firstPassExplanation, int docID)
Parameters
Type | Name | Description |
---|---|---|
IndexSearcher | searcher | |
Explanation | firstPassExplanation | |
int | docID |
Returns
Type | Description |
---|---|
Explanation |
Overrides
Rescore(IndexSearcher, TopDocs, Query, double, int)
Sugar API, calling Rescore(IndexSearcher, TopDocs, int) using a simple linear
combination of firstPassScore + weight
* secondPassScore
Declaration
public static TopDocs Rescore(IndexSearcher searcher, TopDocs topDocs, Query query, double weight, int topN)
Parameters
Type | Name | Description |
---|---|---|
IndexSearcher | searcher | |
TopDocs | topDocs | |
Query | query | |
double | weight | |
int | topN |
Returns
Type | Description |
---|---|
TopDocs |
Rescore(IndexSearcher, TopDocs, int)
Rescore an initial first-pass TopDocs.
Declaration
public override TopDocs Rescore(IndexSearcher searcher, TopDocs firstPassTopDocs, int topN)
Parameters
Type | Name | Description |
---|---|---|
IndexSearcher | searcher | IndexSearcher used to produce the first pass topDocs |
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! |
int | topN | How many re-scored hits to return |
Returns
Type | Description |
---|---|
TopDocs |