Class WeightedSpanTermExtractor
Class used to extract WeightedSpanTerms from a Lucene.Net.Search.Query based on whether Terms from the Lucene.Net.Search.Query are contained in a supplied Lucene.Net.Analysis.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 |
---|---|
Lucene.Net.Analysis.TokenStream |
Methods
| Improve this Doc View SourceCollectSpanQueryFields(SpanQuery, ISet<String>)
Declaration
protected virtual void CollectSpanQueryFields(SpanQuery spanQuery, ISet<string> fieldNames)
Parameters
Type | Name | Description |
---|---|---|
Lucene.Net.Search.Spans.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 |
---|---|---|
Lucene.Net.Search.Query | query | Lucene.Net.Search.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 |
---|---|---|
Lucene.Net.Search.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 | |
Lucene.Net.Search.Spans.SpanQuery | spanQuery | Lucene.Net.Search.Spans.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 | |
Lucene.Net.Search.Query | query | Lucene.Net.Search.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 |
---|---|
Lucene.Net.Index.AtomicReaderContext |
GetWeightedSpanTerms(Query, TokenStream)
Creates an
Declaration
public virtual IDictionary<string, WeightedSpanTerm> GetWeightedSpanTerms(Query query, TokenStream tokenStream)
Parameters
Type | Name | Description |
---|---|---|
Lucene.Net.Search.Query | query | Lucene.Net.Search.Query that caused hit |
Lucene.Net.Analysis.TokenStream | tokenStream | Lucene.Net.Analysis.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 |
---|---|---|
Lucene.Net.Search.Query | query | Lucene.Net.Search.Query that caused hit |
Lucene.Net.Analysis.TokenStream | tokenStream | Lucene.Net.Analysis.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 |
---|---|---|
Lucene.Net.Search.Query | query | Lucene.Net.Search.Query that caused hit |
Lucene.Net.Analysis.TokenStream | tokenStream | Lucene.Net.Analysis.TokenStream of text to be highlighted |
System.String | fieldName | restricts Term's used based on field name |
Lucene.Net.Index.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 |
---|---|---|
Lucene.Net.Search.Spans.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, Lucene.Net.Analysis.TokenStreams that are not of the type CachingTokenFilter are wrapped in a 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 |
---|---|---|
System.Boolean | wrap |