krickert commented on code in PR #15676:
URL: https://github.com/apache/lucene/pull/15676#discussion_r2835370774
##########
lucene/core/src/java/org/apache/lucene/util/hnsw/HnswGraphSearcher.java:
##########
@@ -305,6 +305,13 @@ void searchLevel(
// We should allow exploring equivalent minAcceptedSimilarity values at
least once
boolean shouldExploreMinSim = true;
while (candidates.size() > 0 && results.earlyTerminated() == false) {
+ // Update the threshold dynamically from the collector to allow external
pruning.
+ float liveMinSimilarity = results.minCompetitiveSimilarity();
Review Comment:
**When we're not using external pruning**,
`results.minCompetitiveSimilarity()` still returns the **minimum competitive
similarity** of the current top‑K results, but only from **this shard’s**
collector.
So it's the same kind of threshold (used to prune the graph: skip nodes that
can’t beat the worst of the current top‑K), but it's **not** updated from other
shards.
The loop and the pruning logic are unchanged; only the source of the
threshold is internal (this shard) instead of external (collaborative). In
other words: same API, same pruning, no cross-shard updates when external
pruning is off.
--
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]