Show / Hide Table of Contents

    Class Lookup

    Simple Lookup interface for suggestions.

    This is a Lucene.NET EXPERIMENTAL API, use at your own risk
    Inheritance
    System.Object
    Lookup
    AnalyzingInfixSuggester
    AnalyzingSuggester
    FreeTextSuggester
    FSTCompletionLookup
    WFSTCompletionLookup
    JaspellLookup
    TSTLookup
    Namespace: Lucene.Net.Search.Suggest
    Assembly: Lucene.Net.Suggest.dll
    Syntax
    public abstract class Lookup : object

    Constructors

    | Improve this Doc View Source

    Lookup()

    Sole constructor. (For invocation by subclass constructors, typically implicit.)

    Declaration
    public Lookup()

    Fields

    | Improve this Doc View Source

    CHARSEQUENCE_COMPARER

    A simple char-by-char comparer for

    Declaration
    public static readonly IComparer<string> CHARSEQUENCE_COMPARER
    Field Value
    Type Description
    IComparer<System.String>

    Properties

    | Improve this Doc View Source

    Count

    Get the number of entries the lookup was built with

    Declaration
    public abstract long Count { get; }
    Property Value
    Type Description
    System.Int64

    total number of suggester entries

    Methods

    | Improve this Doc View Source

    Build(IDictionary)

    Build lookup from a dictionary. Some implementations may require sorted or unsorted keys from the dictionary's iterator - use SortedInputIterator or UnsortedInputIterator in such case.

    Declaration
    public virtual void Build(IDictionary dict)
    Parameters
    Type Name Description
    IDictionary dict
    | Improve this Doc View Source

    Build(IInputIterator)

    Builds up a new internal Lookup representation based on the given IInputIterator. The implementation might re-sort the data internally.

    Declaration
    public abstract void Build(IInputIterator inputIterator)
    Parameters
    Type Name Description
    IInputIterator inputIterator
    | Improve this Doc View Source

    DoLookup(String, IEnumerable<BytesRef>, Boolean, Int32)

    Look up a key and return possible completion for this key.

    Declaration
    public abstract IList<Lookup.LookupResult> DoLookup(string key, IEnumerable<BytesRef> contexts, bool onlyMorePopular, int num)
    Parameters
    Type Name Description
    System.String key

    lookup key. Depending on the implementation this may be a prefix, misspelling, or even infix.

    IEnumerable<BytesRef> contexts

    contexts to filter the lookup by, or null if all contexts are allowed; if the suggestion contains any of the contexts, it's a match

    System.Boolean onlyMorePopular

    return only more popular results

    System.Int32 num

    maximum number of results to return

    Returns
    Type Description
    IList<Lookup.LookupResult>

    a list of possible completions, with their relative weight (e.g. popularity)

    | Improve this Doc View Source

    DoLookup(String, Boolean, Int32)

    Look up a key and return possible completion for this key.

    Declaration
    public virtual IList<Lookup.LookupResult> DoLookup(string key, bool onlyMorePopular, int num)
    Parameters
    Type Name Description
    System.String key

    lookup key. Depending on the implementation this may be a prefix, misspelling, or even infix.

    System.Boolean onlyMorePopular

    return only more popular results

    System.Int32 num

    maximum number of results to return

    Returns
    Type Description
    IList<Lookup.LookupResult>

    a list of possible completions, with their relative weight (e.g. popularity)

    | Improve this Doc View Source

    GetSizeInBytes()

    Get the size of the underlying lookup implementation in memory

    Declaration
    public abstract long GetSizeInBytes()
    Returns
    Type Description
    System.Int64

    ram size of the lookup implementation in bytes

    | Improve this Doc View Source

    Load(DataInput)

    Discard current lookup data and load it from a previously saved copy. Optional operation.

    Declaration
    public abstract bool Load(DataInput input)
    Parameters
    Type Name Description
    DataInput input

    the to load the lookup data.

    Returns
    Type Description
    System.Boolean

    true if completed successfully, false if unsuccessful or not supported.

    | Improve this Doc View Source

    Load(Stream)

    Calls Load(DataInput) after converting to

    Declaration
    public virtual bool Load(Stream input)
    Parameters
    Type Name Description
    Stream input
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    Store(DataOutput)

    Persist the constructed lookup data to a directory. Optional operation.

    Declaration
    public abstract bool Store(DataOutput output)
    Parameters
    Type Name Description
    DataOutput output

    to write the data to.

    Returns
    Type Description
    System.Boolean

    true if successful, false if unsuccessful or not supported.

    | Improve this Doc View Source

    Store(Stream)

    Calls Store(DataOutput) after converting to

    Declaration
    public virtual bool Store(Stream output)
    Parameters
    Type Name Description
    Stream output
    Returns
    Type Description
    System.Boolean
    • Improve this Doc
    • View Source
    Back to top Copyright © 2020 Licensed to the Apache Software Foundation (ASF)