You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "benwtrent (via GitHub)" <gi...@apache.org> on 2023/12/07 17:41:23 UTC

Re: [PR] Re-use information from graph traversal during exact search [lucene]

benwtrent commented on code in PR #12820:
URL: https://github.com/apache/lucene/pull/12820#discussion_r1419363698


##########
lucene/core/src/java/org/apache/lucene/search/AbstractKnnCollector.java:
##########
@@ -66,4 +69,19 @@ public final int k() {
 
   @Override
   public abstract TopDocs topDocs();
+
+  @Override
+  public void prepareScratchState(int maxDoc) {
+    if (visited == null) {
+      visited = new FixedBitSet(maxDoc + 1);
+    } else {
+      visited = FixedBitSet.ensureCapacity(visited, maxDoc);
+      visited.clear();
+    }
+  }

Review Comment:
   This is a bad idea, on very large graphs, since we scale logarithmically, sparsebitset would be much better. 
   
   See: https://github.com/apache/lucene/pull/12789



-- 
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-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org