Class QueryScorer
IScorer implementation which scores text fragments by the number of
unique query terms found. This class converts appropriate
Inheritance
Implements
Namespace: Lucene.Net.Search.Highlight
Assembly: Lucene.Net.Highlighter.dll
Syntax
public class QueryScorer : object, 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 |
QueryScorer(Query, IndexReader, String)
Constructs a new QueryScorer instance
Declaration
public QueryScorer(Query query, IndexReader reader, string field)
Parameters
Type | Name | Description |
---|---|---|
Query | query | |
IndexReader | reader | |
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 | |
IndexReader | reader | |
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 | |
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 | |
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 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
NewTermExtractor(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,
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 |