mikemccand / stargazers-migration-test

Testing Lucene's Jira -> GitHub issues migration
0 stars 0 forks source link

TopSuggestDocsCollector#collect should be able to signal rejection [LUCENE-8995] #992

Open mikemccand opened 5 years ago

mikemccand commented 5 years ago

Currently the suggestion collectors collect() method has no way of signaling back to the caller whether the matched completion it received was indeed collected.

While this is currenty always the case for the default TopSuggestDocsCollector, there are implementations that overwrite this with custom collection logic that also deduplicates based on e.g. docID and/or context. Currently if those completions are rejected, the calling TopNSearcher has no way of noting these rejections and might therefore terminate early, thus missing on completions that should be returned.


Legacy Jira details

LUCENE-8995 by Christoph Büscher (@cbuescher) on Oct 01 2019, updated Oct 16 2019

mikemccand commented 5 years ago

+1, it'd be nice if the collect method could communicate whether it filtered the hit or not ... it'd make it easier to make cascading collectors, where the first collector controls whether the subsequent collectors should collect.

I'm pretty sure there was a discussion on the dev list ~ year ago about this exact idea ... maybe dig that up and link it here for some context?

[Legacy Jira: Michael McCandless (@mikemccand) on Oct 01 2019]