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

Remove alphabetically ordered completions from FSTCompletion

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None
    • None
    • New

    Description

      The code cheats internally by sorting completions that are always weight-ordered. If this is needed, it should be done up the call stack, not in FSTCompletion - this provides an illusion of something that doesn't exist and is potentially quite expensive to compute.

          if (!higherWeightsFirst && rootArcs.length > 1) {
            // We could emit a warning here (?). An optimal strategy for
            // alphabetically sorted
            // suggestions would be to add them with a constant weight -- this saves
            // unnecessary
            // traversals and sorting.
            return lookup(key).sorted().limit(num).collect(Collectors.toList());
          } else {
            return lookup(key).limit(num).collect(Collectors.toList());
          }
      

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated: