Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-10539

Return a stream of completions from FSTCompletion

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 9.2
    • None
    • None
    • New

    Description

      FSTLookup currently has a "num" parameter which limits the number of completions from the underlying automaton. But this has severe disadvantages if you need to collect completions that need to fulfill a secondary condition (for example, collect only verbs or terms that contain a certain infix). Then you can't determine the 'num' parameter easily because the number of filtered completions is unknown.

      I also think implementation-wise it's also much nicer to provide a stream that iterates over completions rather than a fixed-size list. This allows for much more elegant code (stream.filter, stream.limit).

      The provided patch adds a single Stream<Completion> lookup(key) method and modifies the existing lookup methods to use it.

      Attachments

        Issue Links

          Activity

            People

              dweiss Dawid Weiss
              dweiss Dawid Weiss
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 10m
                  1h 10m