shubhamvishu commented on code in PR #14963:
URL: https://github.com/apache/lucene/pull/14963#discussion_r2448137576
##########
lucene/core/src/java/org/apache/lucene/codecs/lucene99/Lucene99HnswVectorsFormat.java:
##########
@@ -116,6 +116,18 @@ public final class Lucene99HnswVectorsFormat extends
KnnVectorsFormat {
/** Default to use single thread merge */
public static final int DEFAULT_NUM_MERGE_WORKER = 1;
+ /**
+ * Threshold which HnswGraphSearcher#expectedVisitedNodes uses as k to
determine when HNSW graph
+ * building is bypassed (useful in case if frequent flushes). It is in terms
of k for a graph i.e.
+ * number of docs to match for the query. So having a graph only helps if,
+ *
+ * <pre> k << size / log(size) </pre>
+ *
+ * i.e. k is at least 1 order less than size / log(size) where size if the
number of nodes in the
+ * graph
+ */
+ public static final int HNSW_GRAPH_THRESHOLD = 100;
Review Comment:
Yeah, we don't have this check anymore but in general the math is still
correct. But if adds any confusion, we can omit this part instead?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]