Class WeightedSpanTermExtractor
Class used to extract WeightedSpanTerms from a Lucene.Net.Search.Query based on whether Lucene.Net.Index.Terms from the Lucene.Net.Search.Query are contained in a supplied Lucene.Net.Analysis.TokenStream.
Inherited Members
Namespace: Lucene.Net.Search.Highlight
Assembly: Lucene.Net.Highlighter.dll
Syntax
public class WeightedSpanTermExtractor
Constructors
WeightedSpanTermExtractor()
Class used to extract WeightedSpanTerms from a Lucene.Net.Search.Query based on whether Lucene.Net.Index.Terms from the Lucene.Net.Search.Query are contained in a supplied Lucene.Net.Analysis.TokenStream.
Declaration
public WeightedSpanTermExtractor()
WeightedSpanTermExtractor(string)
Class used to extract WeightedSpanTerms from a Lucene.Net.Search.Query based on whether Lucene.Net.Index.Terms from the Lucene.Net.Search.Query are contained in a supplied Lucene.Net.Analysis.TokenStream.
Declaration
public WeightedSpanTermExtractor(string defaultField)
Parameters
Type | Name | Description |
---|---|---|
string | defaultField |
Properties
ExpandMultiTermQuery
Class used to extract WeightedSpanTerms from a Lucene.Net.Search.Query based on whether Lucene.Net.Index.Terms from the Lucene.Net.Search.Query are contained in a supplied Lucene.Net.Analysis.TokenStream.
Declaration
public virtual bool ExpandMultiTermQuery { get; set; }
Property Value
Type | Description |
---|---|
bool |
IsCachedTokenStream
Class used to extract WeightedSpanTerms from a Lucene.Net.Search.Query based on whether Lucene.Net.Index.Terms from the Lucene.Net.Search.Query are contained in a supplied Lucene.Net.Analysis.TokenStream.
Declaration
public virtual bool IsCachedTokenStream { get; }
Property Value
Type | Description |
---|---|
bool |
TokenStream
Class used to extract WeightedSpanTerms from a Lucene.Net.Search.Query based on whether Lucene.Net.Index.Terms from the Lucene.Net.Search.Query are contained in a supplied Lucene.Net.Analysis.TokenStream.
Declaration
public virtual TokenStream TokenStream { get; }
Property Value
Type | Description |
---|---|
TokenStream |
Methods
CollectSpanQueryFields(SpanQuery, ISet<string>)
Class used to extract WeightedSpanTerms from a Lucene.Net.Search.Query based on whether Lucene.Net.Index.Terms from the Lucene.Net.Search.Query are contained in a supplied Lucene.Net.Analysis.TokenStream.
Declaration
protected virtual void CollectSpanQueryFields(SpanQuery spanQuery, ISet<string> fieldNames)
Parameters
Type | Name | Description |
---|---|---|
SpanQuery | spanQuery | |
ISet<string> | fieldNames |
Extract(Query, IDictionary<string, WeightedSpanTerm>)
Fills a IDictionary{string,WeightedSpanTerm} with WeightedSpanTerms using the terms from the supplied query
.
Declaration
protected virtual void Extract(Query query, IDictionary<string, WeightedSpanTerm> terms)
Parameters
Type | Name | Description |
---|---|---|
Query | query | Lucene.Net.Search.Query to extract Terms from |
IDictionary<string, WeightedSpanTerm> | terms | Map to place created WeightedSpanTerms in |
Exceptions
Type | Condition |
---|---|
IOException | If there is a low-level I/O error |
ExtractUnknownQuery(Query, IDictionary<string, WeightedSpanTerm>)
Class used to extract WeightedSpanTerms from a Lucene.Net.Search.Query based on whether Lucene.Net.Index.Terms from the Lucene.Net.Search.Query are contained in a supplied Lucene.Net.Analysis.TokenStream.
Declaration
protected virtual void ExtractUnknownQuery(Query query, IDictionary<string, WeightedSpanTerm> terms)
Parameters
Type | Name | Description |
---|---|---|
Query | query | |
IDictionary<string, WeightedSpanTerm> | terms |
ExtractWeightedSpanTerms(IDictionary<string, WeightedSpanTerm>, SpanQuery)
Fills a IDictionary{string,WeightedSpanTerm} with WeightedSpanTerms using the terms from the supplied Lucene.Net.Search.Spans.SpanQuery.
Declaration
protected virtual void ExtractWeightedSpanTerms(IDictionary<string, WeightedSpanTerm> terms, SpanQuery spanQuery)
Parameters
Type | Name | Description |
---|---|---|
IDictionary<string, WeightedSpanTerm> | terms | IDictionary{string,WeightedSpanTerm} to place created WeightedSpanTerms in |
SpanQuery | spanQuery | Lucene.Net.Search.Spans.SpanQuery to extract Terms from |
Exceptions
Type | Condition |
---|---|
IOException | If there is a low-level I/O error |
ExtractWeightedTerms(IDictionary<string, WeightedSpanTerm>, Query)
Fills a IDictionary{string,WeightedSpanTerm} with WeightedSpanTerms using the terms from the supplied Lucene.Net.Search.Spans.SpanQuery.
Declaration
protected virtual void ExtractWeightedTerms(IDictionary<string, WeightedSpanTerm> terms, Query query)
Parameters
Type | Name | Description |
---|---|---|
IDictionary<string, WeightedSpanTerm> | terms | IDictionary{string,WeightedSpanTerm} to place created WeightedSpanTerms in |
Query | query | Lucene.Net.Search.Query to extract Terms from |
Exceptions
Type | Condition |
---|---|
IOException | If there is a low-level I/O error |
FieldNameComparer(string)
Necessary to implement matches for queries against defaultField
Declaration
protected virtual bool FieldNameComparer(string fieldNameToCheck)
Parameters
Type | Name | Description |
---|---|---|
string | fieldNameToCheck |
Returns
Type | Description |
---|---|
bool |
GetLeafContext()
Class used to extract WeightedSpanTerms from a Lucene.Net.Search.Query based on whether Lucene.Net.Index.Terms from the Lucene.Net.Search.Query are contained in a supplied Lucene.Net.Analysis.TokenStream.
Declaration
protected virtual AtomicReaderContext GetLeafContext()
Returns
Type | Description |
---|---|
AtomicReaderContext |
GetWeightedSpanTerms(Query, TokenStream)
Creates an IDictionary{string,WeightedSpanTerm} from the given Lucene.Net.Search.Query and Lucene.Net.Analysis.TokenStream.
Declaration
public virtual IDictionary<string, WeightedSpanTerm> GetWeightedSpanTerms(Query query, TokenStream tokenStream)
Parameters
Type | Name | Description |
---|---|---|
Query | query | Lucene.Net.Search.Query that caused hit |
TokenStream | tokenStream | Lucene.Net.Analysis.TokenStream of text to be highlighted |
Returns
Type | Description |
---|---|
IDictionary<string, WeightedSpanTerm> | Map containing WeightedSpanTerms |
Exceptions
Type | Condition |
---|---|
IOException | If there is a low-level I/O error |
GetWeightedSpanTerms(Query, TokenStream, string)
Creates an IDictionary{string,WeightedSpanTerm} from the given Lucene.Net.Search.Query and Lucene.Net.Analysis.TokenStream.
Declaration
public virtual IDictionary<string, WeightedSpanTerm> GetWeightedSpanTerms(Query query, TokenStream tokenStream, string fieldName)
Parameters
Type | Name | Description |
---|---|---|
Query | query | Lucene.Net.Search.Query that caused hit |
TokenStream | tokenStream | Lucene.Net.Analysis.TokenStream of text to be highlighted |
string | fieldName | restricts Term's used based on field name |
Returns
Type | Description |
---|---|
IDictionary<string, WeightedSpanTerm> | Map containing WeightedSpanTerms |
Exceptions
Type | Condition |
---|---|
IOException | If there is a low-level I/O error |
GetWeightedSpanTermsWithScores(Query, TokenStream, string, IndexReader)
Creates an IDictionary{string,WeightedSpanTerm} from the given Lucene.Net.Search.Query and Lucene.Net.Analysis.TokenStream. Uses a supplied Lucene.Net.Index.IndexReader to properly Weight terms (for gradient highlighting).
Declaration
public virtual IDictionary<string, WeightedSpanTerm> GetWeightedSpanTermsWithScores(Query query, TokenStream tokenStream, string fieldName, IndexReader reader)
Parameters
Type | Name | Description |
---|---|---|
Query | query | Lucene.Net.Search.Query that caused hit |
TokenStream | tokenStream | Lucene.Net.Analysis.TokenStream of text to be highlighted |
string | fieldName | restricts Term's used based on field name |
IndexReader | reader | to use for scoring |
Returns
Type | Description |
---|---|
IDictionary<string, WeightedSpanTerm> | Map of WeightedSpanTerms with quasi tf/idf scores |
Exceptions
Type | Condition |
---|---|
IOException | If there is a low-level I/O error |
MustRewriteQuery(SpanQuery)
Class used to extract WeightedSpanTerms from a Lucene.Net.Search.Query based on whether Lucene.Net.Index.Terms from the Lucene.Net.Search.Query are contained in a supplied Lucene.Net.Analysis.TokenStream.
Declaration
protected virtual bool MustRewriteQuery(SpanQuery spanQuery)
Parameters
Type | Name | Description |
---|---|---|
SpanQuery | spanQuery |
Returns
Type | Description |
---|---|
bool |
SetMaxDocCharsToAnalyze(int)
Class used to extract WeightedSpanTerms from a Lucene.Net.Search.Query based on whether Lucene.Net.Index.Terms from the Lucene.Net.Search.Query are contained in a supplied Lucene.Net.Analysis.TokenStream.
Declaration
protected void SetMaxDocCharsToAnalyze(int maxDocCharsToAnalyze)
Parameters
Type | Name | Description |
---|---|---|
int | maxDocCharsToAnalyze |
SetWrapIfNotCachingTokenFilter(bool)
By default, Lucene.Net.Analysis.TokenStreams that are not of the type Lucene.Net.Analysis.CachingTokenFilter are wrapped in a Lucene.Net.Analysis.CachingTokenFilter to Lucene.Net.Analysis.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 |
---|---|---|
bool | wrap |