• API

    Show / Hide Table of Contents

    Namespace Lucene.Net.Search.Suggest

    Support for Autocomplete/Autosuggest

    Classes

    BufferedInputEnumerator

    This wrapper buffers incoming elements.

    This is a Lucene.NET EXPERIMENTAL API, use at your own risk

    BufferingTermFreqEnumeratorWrapper

    This wrapper buffers incoming elements.

    This is a Lucene.NET EXPERIMENTAL API, use at your own risk

    DocumentDictionary

    Dictionary with terms, weights, payload (optional) and contexts (optional) information taken from stored/indexed fields in a Lucene index.

    NOTE:
    • The term and (optionally) payload fields have to be stored
    • The weight field can be stored or can be a NumericDocValues. If the weight field is not defined, the value of the weight is 0
    • if any of the term or (optionally) payload fields supplied do not have a value for a document, then the document is skipped by the dictionary

    DocumentDictionary.DocumentInputEnumerator

    Implements IInputEnumerator from stored fields.

    DocumentValueSourceDictionary

    Dictionary with terms and optionally payload information taken from stored fields in a Lucene index. Similar to DocumentDictionary, except it obtains the weight of the terms in a document based on a Lucene.Net.Queries.Function.ValueSource.

    NOTE:
    • The term and (optionally) payload fields have to be stored
    • if the term or (optionally) payload fields supplied do not have a value for a document, then the document is rejected by the dictionary

    In practice the Lucene.Net.Queries.Function.ValueSource will likely be obtained using the lucene expression module. The following example shows how to create a Lucene.Net.Queries.Function.ValueSource from a simple addition of two fields:

      Expression expression = JavascriptCompiler.Compile("f1 + f2");
      SimpleBindings bindings = new SimpleBindings();
      bindings.Add(new SortField("f1", SortField.Type_e.LONG));
      bindings.Add(new SortField("f2", SortField.Type_e.LONG));
      ValueSource valueSource = expression.GetValueSource(bindings);

    FileDictionary

    Dictionary represented by a text file.

    Format allowed: 1 entry per line:

    An entry can be:

    1. suggestion
    2. suggestion Lucene.Net.Search.Suggest.FileDictionary.fieldDelimiter weight
    3. suggestion Lucene.Net.Search.Suggest.FileDictionary.fieldDelimiter weight Lucene.Net.Search.Suggest.FileDictionary.fieldDelimiter payload
    where the default Lucene.Net.Search.Suggest.FileDictionary.fieldDelimiter is DEFAULT_FIELD_DELIMITER (a tab)

    NOTE:

    1. In order to have payload enabled, the first entry has to have a payload
    2. If the weight for an entry is not specified then a value of 1 is used
    3. A payload cannot be specified without having the weight specified for an entry
    4. If the payload for an entry is not specified (assuming payload is enabled) then an empty payload is returned
    5. An entry cannot have more than two Lucene.Net.Search.Suggest.FileDictionary.fieldDelimiters

    Example:

    word1 word2 TAB 100 TAB payload1

    word3 TAB 101

    word4 word3 TAB 102

    InMemorySorter

    An IBytesRefSorter that keeps all the entries in memory.

    This is a Lucene.NET EXPERIMENTAL API, use at your own risk
    This is a Lucene.NET INTERNAL API, use at your own risk

    InputEnumerator

    InputEnumeratorWrapper

    Wraps a Lucene.Net.Util.IBytesRefEnumerator as a suggester IInputEnumerator, with all weights set to 1 and carries no payload

    Lookup

    Simple Lookup interface for System.String suggestions.

    This is a Lucene.NET EXPERIMENTAL API, use at your own risk

    Lookup.LookupPriorityQueue

    A Lucene.Net.Util.PriorityQueue<T> collecting a fixed size of high priority Lookup.LookupResults.

    Lookup.LookupResult

    Result of a lookup.

    This is a Lucene.NET EXPERIMENTAL API, use at your own risk

    SortedInputEnumerator

    This wrapper buffers incoming elements and makes sure they are sorted based on given comparer.

    This is a Lucene.NET EXPERIMENTAL API, use at your own risk

    SortedTermFreqEnumeratorWrapper

    This wrapper buffers incoming elements and makes sure they are sorted based on given comparer.

    This is a Lucene.NET EXPERIMENTAL API, use at your own risk

    UnsortedInputEnumerator

    This wrapper buffers the incoming elements and makes sure they are in random order.

    This is a Lucene.NET EXPERIMENTAL API, use at your own risk

    Interfaces

    IInputEnumerator

    Interface for enumerating term,weight,payload triples for suggester consumption; currently only AnalyzingSuggester, FuzzySuggester and AnalyzingInfixSuggester support payloads.

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