Class WeightedSpanTermExtractor
Class used to extract WeightedSpanTerms from a Query based on whether Terms from the Query are contained in a supplied TokenStream.
Inheritance
Inherited Members
Namespace: Lucene.Net.Search.Highlight
Assembly: Lucene.Net.Highlighter.dll
Syntax
public class WeightedSpanTermExtractor
Constructors
| Improve this Doc View SourceWeightedSpanTermExtractor()
Declaration
public WeightedSpanTermExtractor()
WeightedSpanTermExtractor(String)
Declaration
public WeightedSpanTermExtractor(string defaultField)
Parameters
Type | Name | Description |
---|---|---|
System.String | defaultField |
Properties
| Improve this Doc View SourceExpandMultiTermQuery
Declaration
public virtual bool ExpandMultiTermQuery { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsCachedTokenStream
Declaration
public virtual bool IsCachedTokenStream { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
TokenStream
Declaration
public virtual TokenStream TokenStream { get; }
Property Value
Type | Description |
---|---|
TokenStream |
Methods
| Improve this Doc View SourceCollectSpanQueryFields(SpanQuery, ISet<String>)
Declaration
protected virtual void CollectSpanQueryFields(SpanQuery spanQuery, ISet<string> fieldNames)
Parameters
Type | Name | Description |
---|---|---|
SpanQuery | spanQuery | |
System.Collections.Generic.ISet<System.String> | fieldNames |
Extract(Query, IDictionary<String, WeightedSpanTerm>)
Fills a query
.
Declaration
protected virtual void Extract(Query query, IDictionary<string, WeightedSpanTerm> terms)
Parameters
Type | Name | Description |
---|---|---|
Query | query | Query to extract Terms from |
System.Collections.Generic.IDictionary<System.String, WeightedSpanTerm> | terms | Map to place created WeightedSpanTerms in |
Exceptions
Type | Condition |
---|---|
System.IO.IOException | If there is a low-level I/O error |
ExtractUnknownQuery(Query, IDictionary<String, WeightedSpanTerm>)
Declaration
protected virtual void ExtractUnknownQuery(Query query, IDictionary<string, WeightedSpanTerm> terms)
Parameters
Type | Name | Description |
---|---|---|
Query | query | |
System.Collections.Generic.IDictionary<System.String, WeightedSpanTerm> | terms |
ExtractWeightedSpanTerms(IDictionary<String, WeightedSpanTerm>, SpanQuery)
Fills a
Declaration
protected virtual void ExtractWeightedSpanTerms(IDictionary<string, WeightedSpanTerm> terms, SpanQuery spanQuery)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IDictionary<System.String, WeightedSpanTerm> | terms | |
SpanQuery | spanQuery | SpanQuery to extract Terms from |
Exceptions
Type | Condition |
---|---|
System.IO.IOException | If there is a low-level I/O error |
ExtractWeightedTerms(IDictionary<String, WeightedSpanTerm>, Query)
Fills a
Declaration
protected virtual void ExtractWeightedTerms(IDictionary<string, WeightedSpanTerm> terms, Query query)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IDictionary<System.String, WeightedSpanTerm> | terms | |
Query | query | Query to extract Terms from |
Exceptions
Type | Condition |
---|---|
System.IO.IOException | If there is a low-level I/O error |
FieldNameComparer(String)
Necessary to implement matches for queries against Lucene.Net.Search.Highlight.WeightedSpanTermExtractor.defaultField
Declaration
protected virtual bool FieldNameComparer(string fieldNameToCheck)
Parameters
Type | Name | Description |
---|---|---|
System.String | fieldNameToCheck |
Returns
Type | Description |
---|---|
System.Boolean |
GetLeafContext()
Declaration
protected virtual AtomicReaderContext GetLeafContext()
Returns
Type | Description |
---|---|
AtomicReaderContext |
GetWeightedSpanTerms(Query, TokenStream)
Creates an
Declaration
public virtual IDictionary<string, WeightedSpanTerm> GetWeightedSpanTerms(Query query, TokenStream tokenStream)
Parameters
Type | Name | Description |
---|---|---|
Query | query | Query that caused hit |
TokenStream | tokenStream | TokenStream of text to be highlighted |
Returns
Type | Description |
---|---|
System.Collections.Generic.IDictionary<System.String, WeightedSpanTerm> | Map containing WeightedSpanTerms |
Exceptions
Type | Condition |
---|---|
System.IO.IOException | If there is a low-level I/O error |
GetWeightedSpanTerms(Query, TokenStream, String)
Creates an
Declaration
public virtual IDictionary<string, WeightedSpanTerm> GetWeightedSpanTerms(Query query, TokenStream tokenStream, string fieldName)
Parameters
Type | Name | Description |
---|---|---|
Query | query | Query that caused hit |
TokenStream | tokenStream | TokenStream of text to be highlighted |
System.String | fieldName | restricts Term's used based on field name |
Returns
Type | Description |
---|---|
System.Collections.Generic.IDictionary<System.String, WeightedSpanTerm> | Map containing WeightedSpanTerms |
Exceptions
Type | Condition |
---|---|
System.IO.IOException | If there is a low-level I/O error |
GetWeightedSpanTermsWithScores(Query, TokenStream, String, IndexReader)
Creates an
Declaration
public virtual IDictionary<string, WeightedSpanTerm> GetWeightedSpanTermsWithScores(Query query, TokenStream tokenStream, string fieldName, IndexReader reader)
Parameters
Type | Name | Description |
---|---|---|
Query | query | Query that caused hit |
TokenStream | tokenStream | TokenStream of text to be highlighted |
System.String | fieldName | restricts Term's used based on field name |
IndexReader | reader | to use for scoring |
Returns
Type | Description |
---|---|
System.Collections.Generic.IDictionary<System.String, WeightedSpanTerm> | Map of WeightedSpanTerms with quasi tf/idf scores |
Exceptions
Type | Condition |
---|---|
System.IO.IOException | If there is a low-level I/O error |
MustRewriteQuery(SpanQuery)
Declaration
protected virtual bool MustRewriteQuery(SpanQuery spanQuery)
Parameters
Type | Name | Description |
---|---|---|
SpanQuery | spanQuery |
Returns
Type | Description |
---|---|
System.Boolean |
SetMaxDocCharsToAnalyze(Int32)
Declaration
protected 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 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 |