Show / Hide Table of Contents

    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
    Lookup
    AnalyzingInfixSuggester
    BlendedInfixSuggester
    Implements
    IDisposable
    Inherited Members
    AnalyzingInfixSuggester.TEXT_FIELD_NAME
    AnalyzingInfixSuggester.EXACT_TEXT_FIELD_NAME
    AnalyzingInfixSuggester.CONTEXTS_FIELD_NAME
    AnalyzingInfixSuggester.m_queryAnalyzer
    AnalyzingInfixSuggester.m_indexAnalyzer
    AnalyzingInfixSuggester.m_searcherMgr
    AnalyzingInfixSuggester.DEFAULT_MIN_PREFIX_CHARS
    AnalyzingInfixSuggester.GetIndexWriterConfig(LuceneVersion, Analyzer, OpenMode)
    AnalyzingInfixSuggester.GetDirectory(DirectoryInfo)
    AnalyzingInfixSuggester.Build(IInputIterator)
    AnalyzingInfixSuggester.Add(BytesRef, IEnumerable<BytesRef>, Int64, BytesRef)
    AnalyzingInfixSuggester.Update(BytesRef, IEnumerable<BytesRef>, Int64, BytesRef)
    AnalyzingInfixSuggester.Refresh()
    AnalyzingInfixSuggester.DoLookup(String, Int32, Boolean, Boolean)
    AnalyzingInfixSuggester.GetLastTokenQuery(String)
    AnalyzingInfixSuggester.FinishQuery(BooleanQuery, Boolean)
    AnalyzingInfixSuggester.Highlight(String, IEnumerable<String>, String)
    AnalyzingInfixSuggester.AddNonMatch(StringBuilder, String)
    AnalyzingInfixSuggester.AddWholeMatch(StringBuilder, String, String)
    AnalyzingInfixSuggester.AddPrefixMatch(StringBuilder, String, String, String)
    AnalyzingInfixSuggester.Store(DataOutput)
    AnalyzingInfixSuggester.Load(DataInput)
    AnalyzingInfixSuggester.Dispose()
    AnalyzingInfixSuggester.GetSizeInBytes()
    AnalyzingInfixSuggester.Count
    Lookup.CHARSEQUENCE_COMPARER
    Lookup.Build(IDictionary)
    Lookup.Load(Stream)
    Lookup.Store(Stream)
    Lookup.DoLookup(String, Boolean, Int32)
    Namespace: Lucene.Net.Search.Suggest.Analyzing
    Assembly: Lucene.Net.Suggest.dll
    Syntax
    public class BlendedInfixSuggester : AnalyzingInfixSuggester, IDisposable

    Constructors

    | Improve this Doc View Source

    BlendedInfixSuggester(LuceneVersion, Store.Directory, Analyzer)

    Create a new instance, loading from a previously built directory, if it exists.

    Declaration
    public BlendedInfixSuggester(LuceneVersion matchVersion, Store.Directory dir, Analyzer analyzer)
    Parameters
    Type Name Description
    LuceneVersion matchVersion
    Store.Directory dir
    Analyzer analyzer
    | Improve this Doc View Source

    BlendedInfixSuggester(LuceneVersion, Store.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, Store.Directory dir, Analyzer indexAnalyzer, Analyzer queryAnalyzer, int minPrefixChars, BlendedInfixSuggester.BlenderType blenderType, int numFactor)
    Parameters
    Type Name Description
    LuceneVersion matchVersion
    Store.Directory dir
    Analyzer indexAnalyzer
    Analyzer queryAnalyzer
    System.Int32 minPrefixChars
    BlendedInfixSuggester.BlenderType blenderType

    Type of blending strategy, see BlenderType for more precisions

    System.Int32 numFactor

    Factor to multiply the number of searched elements before ponderate

    Fields

    | Improve this Doc View Source

    DEFAULT_NUM_FACTOR

    Default 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
    IEnumerable<System.String> matchedTokens
    System.String prefixToken
    Returns
    Type Description
    IList<Lookup.LookupResult>
    Overrides
    AnalyzingInfixSuggester.CreateResults(IndexSearcher, TopFieldDocs, Int32, String, Boolean, IEnumerable<String>, String)
    | 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
    IEnumerable<BytesRef> contexts
    System.Boolean onlyMorePopular
    System.Int32 num
    Returns
    Type Description
    IList<Lookup.LookupResult>
    Overrides
    AnalyzingInfixSuggester.DoLookup(String, IEnumerable<BytesRef>, Boolean, Int32)
    | 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
    IEnumerable<BytesRef> contexts
    System.Int32 num
    System.Boolean allTermsRequired
    System.Boolean doHighlight
    Returns
    Type Description
    IList<Lookup.LookupResult>
    Overrides
    AnalyzingInfixSuggester.DoLookup(String, IEnumerable<BytesRef>, Int32, Boolean, Boolean)
    | Improve this Doc View Source

    GetTextFieldType()

    Declaration
    protected override FieldType GetTextFieldType()
    Returns
    Type Description
    FieldType
    Overrides
    AnalyzingInfixSuggester.GetTextFieldType()

    Implements

    IDisposable
    • Improve this Doc
    • View Source
    Back to top Copyright © 2020 Licensed to the Apache Software Foundation (ASF)