Show / Hide Table of Contents

    Class FSTCompletion

    Finite state automata based implementation of "autocomplete" functionality.

    Inheritance
    System.Object
    FSTCompletion
    Namespace: Lucene.Net.Search.Suggest.Fst
    Assembly: Lucene.Net.Suggest.dll
    Syntax
    public class FSTCompletion : object

    Constructors

    | Improve this Doc View Source

    FSTCompletion(FST<Object>)

    Defaults to higher weights first and exact first.

    Declaration
    public FSTCompletion(FST<object> automaton)
    Parameters
    Type Name Description
    FST<System.Object> automaton
    See Also
    FSTCompletion(FST<Object>, Boolean, Boolean)
    | Improve this Doc View Source

    FSTCompletion(FST<Object>, Boolean, Boolean)

    Constructs an FSTCompletion, specifying higherWeightsFirst and exactFirst.

    Declaration
    public FSTCompletion(FST<object> automaton, bool higherWeightsFirst, bool exactFirst)
    Parameters
    Type Name Description
    FST<System.Object> automaton

    Automaton with completions. See FSTCompletionBuilder.

    System.Boolean higherWeightsFirst

    Return most popular suggestions first. This is the default behavior for this implementation. Setting it to false has no effect (use constant term weights to sort alphabetically only).

    System.Boolean exactFirst

    Find and push an exact match to the first position of the result list if found.

    Fields

    | Improve this Doc View Source

    DEFAULT_BUCKETS

    Default number of buckets.

    Declaration
    public const int DEFAULT_BUCKETS = null
    Field Value
    Type Description
    System.Int32

    Properties

    | Improve this Doc View Source

    BucketCount

    Returns the bucket count (discretization thresholds).

    Declaration
    public virtual int BucketCount { get; }
    Property Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    FST

    Returns the internal automaton.

    Declaration
    public virtual FST<object> FST { get; }
    Property Value
    Type Description
    FST<System.Object>

    Methods

    | Improve this Doc View Source

    DoLookup(String, Int32)

    Lookup suggestions to key.

    Declaration
    public virtual IList<FSTCompletion.Completion> DoLookup(string key, int num)
    Parameters
    Type Name Description
    System.String key

    The prefix to which suggestions should be sought.

    System.Int32 num

    At most this number of suggestions will be returned.

    Returns
    Type Description
    IList<FSTCompletion.Completion>

    Returns the suggestions, sorted by their approximated weight first (decreasing) and then alphabetically (UTF-8 codepoint order).

    | Improve this Doc View Source

    GetBucket(String)

    Returns the bucket assigned to a given key (if found) or -1 if no exact match exists.

    Declaration
    public virtual int GetBucket(string key)
    Parameters
    Type Name Description
    System.String key
    Returns
    Type Description
    System.Int32

    See Also

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