kaivalnp commented on code in PR #951: URL: https://github.com/apache/lucene/pull/951#discussion_r902336738
########## lucene/core/src/java/org/apache/lucene/search/KnnVectorQuery.java: ########## @@ -121,35 +140,15 @@ public Query rewrite(IndexReader reader) throws IOException { return createRewrittenQuery(reader, topK); } - private TopDocs searchLeaf(LeafReaderContext ctx, BitSetCollector filterCollector) - throws IOException { - - if (filterCollector == null) { - Bits acceptDocs = ctx.reader().getLiveDocs(); - return approximateSearch(ctx, acceptDocs, Integer.MAX_VALUE); + private TopDocs searchLeaf(LeafReaderContext ctx, Bits acceptDocs, int cost) throws IOException { + TopDocs results = approximateSearch(ctx, acceptDocs, cost); Review Comment: Yes, makes sense! Will add it -- 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. To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org