Class QueryScorer
IScorer implementation which scores text fragments by the number of unique query terms found. This class converts appropriate Querys to SpanQuerys and attempts to score only those terms that participated in generating the 'hit' on the document.
Inheritance
Implements
Inherited Members
Namespace: Lucene.Net.Search.Highlight
Assembly: Lucene.Net.Highlighter.dll
Syntax
public class QueryScorer : IScorer
Constructors
| Improve this Doc View SourceQueryScorer(WeightedSpanTerm[])
Constructs a new QueryScorer instance
Declaration
public QueryScorer(WeightedSpanTerm[] weightedTerms)
Parameters
Type | Name | Description |
---|---|---|
WeightedSpanTerm[] | weightedTerms | an array of pre-created WeightedSpanTerms |
QueryScorer(Query)
Constructs a new QueryScorer instance
Declaration
public QueryScorer(Query query)
Parameters
Type | Name | Description |
---|---|---|
Query | query | Query to use for highlighting |
QueryScorer(Query, IndexReader, String)
Constructs a new QueryScorer instance
Declaration
public QueryScorer(Query query, IndexReader reader, string field)
Parameters
Type | Name | Description |
---|---|---|
Query | query | Query to use for highlighting |
IndexReader | reader | IndexReader to use for quasi tf/idf scoring |
System.String | field | Field to highlight - pass null to ignore fields |
QueryScorer(Query, IndexReader, String, String)
Constructs a new QueryScorer instance
Declaration
public QueryScorer(Query query, IndexReader reader, string field, string defaultField)
Parameters
Type | Name | Description |
---|---|---|
Query | query | Query to use for highlighting |
IndexReader | reader | IndexReader to use for quasi tf/idf scoring |
System.String | field | Field to highlight - pass null to ignore fields |
System.String | defaultField | The default field for queries with the field name unspecified |
QueryScorer(Query, String)
Constructs a new QueryScorer instance
Declaration
public QueryScorer(Query query, string field)
Parameters
Type | Name | Description |
---|---|---|
Query | query | Query to use for highlighting |
System.String | field | Field to highlight - pass null to ignore fields |
QueryScorer(Query, String, String)
Constructs a new QueryScorer instance
Declaration
public QueryScorer(Query query, string field, string defaultField)
Parameters
Type | Name | Description |
---|---|---|
Query | query | Query to use for highlighting |
System.String | field | Field to highlight - pass null to ignore fields |
System.String | defaultField | The default field for queries with the field name unspecified |
Properties
| Improve this Doc View SourceExpandMultiTermQuery
Controls whether or not multi-term queries are expanded
against a MemoryIndex IndexReader.
true
if multi-term queries should be expanded
Declaration
public virtual bool ExpandMultiTermQuery { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
FragmentScore
Declaration
public virtual float FragmentScore { get; }
Property Value
Type | Description |
---|---|
System.Single |
See Also
| Improve this Doc View SourceMaxTermWeight
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 |
---|---|
System.Single |
Methods
| Improve this Doc View SourceGetTokenScore()
Declaration
public virtual float GetTokenScore()
Returns
Type | Description |
---|---|
System.Single |
See Also
| Improve this Doc View SourceGetWeightedSpanTerm(String)
Retrieve the WeightedSpanTerm for the specified token. Useful for passing Span information to a IFragmenter.
Declaration
public virtual WeightedSpanTerm GetWeightedSpanTerm(string token)
Parameters
Type | Name | Description |
---|---|---|
System.String | token | token to get WeightedSpanTerm for |
Returns
Type | Description |
---|---|
WeightedSpanTerm | WeightedSpanTerm for token |
Init(TokenStream)
Declaration
public virtual TokenStream Init(TokenStream tokenStream)
Parameters
Type | Name | Description |
---|---|---|
TokenStream | tokenStream |
Returns
Type | Description |
---|---|
TokenStream |
See Also
| Improve this Doc View SourceNewTermExtractor(String)
Declaration
protected virtual WeightedSpanTermExtractor NewTermExtractor(string defaultField)
Parameters
Type | Name | Description |
---|---|---|
System.String | defaultField |
Returns
Type | Description |
---|---|
WeightedSpanTermExtractor |
SetMaxDocCharsToAnalyze(Int32)
Declaration
public virtual void SetMaxDocCharsToAnalyze(int maxDocCharsToAnalyze)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | maxDocCharsToAnalyze |
SetWrapIfNotCachingTokenFilter(Boolean)
By default, TokenStreams that are not of the type CachingTokenFilter are wrapped in a CachingTokenFilter to ensure an efficient reset - if you are already using a different caching TokenStream impl and you don't want it to be wrapped, set this to false.
Declaration
public virtual void SetWrapIfNotCachingTokenFilter(bool wrap)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | wrap |
StartFragment(TextFragment)
Declaration
public virtual void StartFragment(TextFragment newFragment)
Parameters
Type | Name | Description |
---|---|---|
TextFragment | newFragment |