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
- is related to
-
LUCENE-10539 Return a stream of completions from FSTCompletion
- Resolved