[ https://issues.apache.org/jira/browse/LUCENE-10539?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17530209#comment-17530209 ]
ASF subversion and git services commented on LUCENE-10539: ---------------------------------------------------------- Commit d0ce05888d62eadf4e1172339338a389b37dad41 in lucene's branch refs/heads/branch_9x from Dawid Weiss [ https://gitbox.apache.org/repos/asf?p=lucene.git;h=d0ce05888d6 ] LUCENE-10539: Return a stream of completions from FSTCompletion. (#844) > Return a stream of completions from FSTCompletion > ------------------------------------------------- > > Key: LUCENE-10539 > URL: https://issues.apache.org/jira/browse/LUCENE-10539 > Project: Lucene - Core > Issue Type: New Feature > Reporter: Dawid Weiss > Assignee: Dawid Weiss > Priority: Minor > Fix For: 9.2 > > Time Spent: 1h 10m > Remaining Estimate: 0h > > 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. -- This message was sent by Atlassian Jira (v8.20.7#820007) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org