org.apache.lucene.search.suggest.document

Class NRTSuggester

  • All Implemented Interfaces:
    Accountable


    public final class NRTSuggester
    extends Object
    implements Accountable

    NRTSuggester executes Top N search on a weighted FST specified by a CompletionScorer

    See lookup(CompletionScorer, Bits, TopSuggestDocsCollector) for more implementation details.

    FST Format:

    • Input: analyzed forms of input terms
    • Output: Pair<Long, BytesRef> containing weight, surface form and docID

    NOTE:

    • having too many deletions or using a very restrictive filter can make the search inadmissible due to over-pruning of potential paths. See CompletionScorer.accept(int, Bits)
    • when matched documents are arbitrarily filtered (CompletionScorer.filtered set to true, it is assumed that the filter will roughly filter out half the number of documents that match the provided automaton
    • lookup performance will degrade as more accepted completions lead to filtered out documents