jimczi commented on a change in pull request #913: LUCENE-8995: TopSuggestDocsCollector#collect should be able to signal rejection URL: https://github.com/apache/lucene-solr/pull/913#discussion_r330659818
########## File path: lucene/suggest/src/java/org/apache/lucene/search/suggest/document/NRTSuggester.java ########## @@ -283,17 +299,25 @@ public int compare(Pair<Long, BytesRef> o1, Pair<Long, BytesRef> o2) { * <p> * If a <code>filter</code> is applied, the queue size is increased by * half the number of live documents. + * + * If the collector can reject documents upon collecting, the queue size is + * increased by half the number of live documents again. + * * <p> * The maximum queue size is {@link #MAX_TOP_N_QUEUE_SIZE} */ - private int getMaxTopNSearcherQueueSize(int topN, int numDocs, double liveDocsRatio, boolean filterEnabled) { + private int getMaxTopNSearcherQueueSize(int topN, int numDocs, double liveDocsRatio, boolean filterEnabled, Review comment: I am not sure we need to differentiate the case where there is a filter and when the collector can reject. It's the same thing, we don't know the number of rejections beforehand so just adding `(numDocs/2)` once should be enough. So we can maybe just merge the two boolean and applies the heuristic once ? ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org