Class QueryTermScorer
IScorer implementation which scores text fragments by the number of unique query terms found. This class uses the QueryTermExtractor class to process determine the query terms and their boosts to be used.
Implements
Inherited Members
Namespace: Lucene.Net.Search.Highlight
Assembly: Lucene.Net.Highlighter.dll
Syntax
public class QueryTermScorer : IScorer
Constructors
QueryTermScorer(WeightedTerm[])
IScorer implementation which scores text fragments by the number of unique query terms found. This class uses the QueryTermExtractor class to process determine the query terms and their boosts to be used.
Declaration
public QueryTermScorer(WeightedTerm[] weightedTerms)
Parameters
| Type | Name | Description |
|---|---|---|
| WeightedTerm[] | weightedTerms |
QueryTermScorer(Query)
IScorer implementation which scores text fragments by the number of unique query terms found. This class uses the QueryTermExtractor class to process determine the query terms and their boosts to be used.
Declaration
public QueryTermScorer(Query query)
Parameters
| Type | Name | Description |
|---|---|---|
| Query | query | a Lucene query (ideally rewritten using Lucene.Net.Search.Query.Rewrite(Lucene.Net.Index.IndexReader) before being passed to this class and the searcher) |
QueryTermScorer(Query, IndexReader, string)
IScorer implementation which scores text fragments by the number of unique query terms found. This class uses the QueryTermExtractor class to process determine the query terms and their boosts to be used.
Declaration
public QueryTermScorer(Query query, IndexReader reader, string fieldName)
Parameters
| Type | Name | Description |
|---|---|---|
| Query | query | a Lucene query (ideally rewritten using Lucene.Net.Search.Query.Rewrite(Lucene.Net.Index.IndexReader) before being passed to this class and the searcher) |
| IndexReader | reader | used to compute IDF which can be used to a) score selected fragments better b) use graded highlights eg set font color intensity |
| string | fieldName | the field on which Inverse Document Frequency (IDF) calculations are based |
QueryTermScorer(Query, string)
IScorer implementation which scores text fragments by the number of unique query terms found. This class uses the QueryTermExtractor class to process determine the query terms and their boosts to be used.
Declaration
public QueryTermScorer(Query query, string fieldName)
Parameters
| Type | Name | Description |
|---|---|---|
| Query | query | a Lucene query (ideally rewritten using Lucene.Net.Search.Query.Rewrite(Lucene.Net.Index.IndexReader) before being passed to this class and the searcher) |
| string | fieldName | the Field name which is used to match Query terms |
Properties
FragmentScore
Declaration
public virtual float FragmentScore { get; }
Property Value
| Type | Description |
|---|---|
| float |
MaxTermWeight
The highest weighted term (useful for passing to GradientFormatter to set top end of coloring scale.
Declaration
public virtual float MaxTermWeight { get; }
Property Value
| Type | Description |
|---|---|
| float |
Methods
AllFragmentsProcessed()
IScorer implementation which scores text fragments by the number of unique query terms found. This class uses the QueryTermExtractor class to process determine the query terms and their boosts to be used.
Declaration
public virtual void AllFragmentsProcessed()
GetTokenScore()
Declaration
public virtual float GetTokenScore()
Returns
| Type | Description |
|---|---|
| float |
Init(TokenStream)
Declaration
public virtual TokenStream Init(TokenStream tokenStream)
Parameters
| Type | Name | Description |
|---|---|---|
| TokenStream | tokenStream |
Returns
| Type | Description |
|---|---|
| TokenStream |
StartFragment(TextFragment)
Called when a new fragment is started for consideration.
Declaration
public virtual void StartFragment(TextFragment newFragment)
Parameters
| Type | Name | Description |
|---|---|---|
| TextFragment | newFragment | the fragment that will be scored next |