Class BlendedInfixSuggester
Extension of the AnalyzingInfixSuggester which transforms the weight
after search to take into account the position of the searched term into
the indexed text.
Please note that it increases the number of elements searched and applies the
ponderation after. It might be costly for long suggestions.
This is a Lucene.NET EXPERIMENTAL API, use at your own risk
Inheritance
System.Object
BlendedInfixSuggester
Implements
System.IDisposable
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: Lucene.Net.Suggest.dll
Syntax
public class BlendedInfixSuggester : AnalyzingInfixSuggester, IDisposable
Constructors
|
Improve this Doc
View Source
BlendedInfixSuggester(LuceneVersion, Directory, Analyzer)
Create a new instance, loading from a previously built
directory, if it exists.
Declaration
public BlendedInfixSuggester(LuceneVersion matchVersion, Directory dir, Analyzer analyzer)
Parameters
|
Improve this Doc
View Source
BlendedInfixSuggester(LuceneVersion, Directory, Analyzer, Analyzer, Int32, BlendedInfixSuggester.BlenderType, Int32)
Create a new instance, loading from a previously built
directory, if it exists.
Declaration
public BlendedInfixSuggester(LuceneVersion matchVersion, Directory dir, Analyzer indexAnalyzer, Analyzer queryAnalyzer, int minPrefixChars, BlendedInfixSuggester.BlenderType blenderType, int numFactor)
Parameters
Exceptions
Type |
Condition |
System.IO.IOException |
If there are problems opening the underlying Lucene index.
|
Fields
|
Improve this Doc
View Source
DEFAULT_NUM_FACTOR
Declaration
public static int DEFAULT_NUM_FACTOR
Field Value
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
LINEAR_COEF
Coefficient used for linear blending
Declaration
protected static double LINEAR_COEF
Field Value
Type |
Description |
System.Double |
|
Methods
|
Improve this Doc
View Source
CalculateCoefficient(Int32)
Calculate the weight coefficient based on the position of the first matching word.
Subclass should override it to adapt it to particular needs
Declaration
protected virtual double CalculateCoefficient(int position)
Parameters
Type |
Name |
Description |
System.Int32 |
position |
of the first matching word in text
|
Returns
Type |
Description |
System.Double |
the coefficient
|
|
Improve this Doc
View Source
CreateResults(IndexSearcher, TopFieldDocs, Int32, String, Boolean, IEnumerable<String>, String)
Declaration
protected override IList<Lookup.LookupResult> CreateResults(IndexSearcher searcher, TopFieldDocs hits, int num, string key, bool doHighlight, IEnumerable<string> matchedTokens, string prefixToken)
Parameters
Type |
Name |
Description |
IndexSearcher |
searcher |
|
TopFieldDocs |
hits |
|
System.Int32 |
num |
|
System.String |
key |
|
System.Boolean |
doHighlight |
|
System.Collections.Generic.IEnumerable<System.String> |
matchedTokens |
|
System.String |
prefixToken |
|
Returns
Overrides
|
Improve this Doc
View Source
DoLookup(String, IEnumerable<BytesRef>, Boolean, Int32)
Declaration
public override IList<Lookup.LookupResult> DoLookup(string key, IEnumerable<BytesRef> contexts, bool onlyMorePopular, int num)
Parameters
Type |
Name |
Description |
System.String |
key |
|
System.Collections.Generic.IEnumerable<BytesRef> |
contexts |
|
System.Boolean |
onlyMorePopular |
|
System.Int32 |
num |
|
Returns
Overrides
|
Improve this Doc
View Source
DoLookup(String, IEnumerable<BytesRef>, Int32, Boolean, Boolean)
Declaration
public override IList<Lookup.LookupResult> DoLookup(string key, IEnumerable<BytesRef> contexts, int num, bool allTermsRequired, bool doHighlight)
Parameters
Type |
Name |
Description |
System.String |
key |
|
System.Collections.Generic.IEnumerable<BytesRef> |
contexts |
|
System.Int32 |
num |
|
System.Boolean |
allTermsRequired |
|
System.Boolean |
doHighlight |
|
Returns
Overrides
|
Improve this Doc
View Source
GetTextFieldType()
Declaration
protected override FieldType GetTextFieldType()
Returns
Overrides
Implements
System.IDisposable