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
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Lucene.Net.Search
Assembly: Lucene.Net.dll
Syntax
public abstract class QueryRescorer : Rescorer
Constructors
| Improve this Doc View SourceQueryRescorer(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
| Improve this Doc View SourceCombine(Single, Boolean, Single)
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 |
---|---|---|
System.Single | firstPassScore | |
System.Boolean | secondPassMatches | |
System.Single | secondPassScore |
Returns
Type | Description |
---|---|
System.Single |
Explain(IndexSearcher, Explanation, Int32)
Declaration
public override Explanation Explain(IndexSearcher searcher, Explanation firstPassExplanation, int docID)
Parameters
Type | Name | Description |
---|---|---|
IndexSearcher | searcher | |
Explanation | firstPassExplanation | |
System.Int32 | docID |
Returns
Type | Description |
---|---|
Explanation |
Overrides
| Improve this Doc View SourceRescore(IndexSearcher, TopDocs, Query, Double, Int32)
Sugar API, calling Rescore(IndexSearcher, TopDocs, Int32) 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 | |
System.Double | weight | |
System.Int32 | topN |
Returns
Type | Description |
---|---|
TopDocs |
Rescore(IndexSearcher, TopDocs, Int32)
Declaration
public override TopDocs Rescore(IndexSearcher searcher, TopDocs firstPassTopDocs, int topN)
Parameters
Type | Name | Description |
---|---|---|
IndexSearcher | searcher | |
TopDocs | firstPassTopDocs | |
System.Int32 | topN |
Returns
Type | Description |
---|---|
TopDocs |