add enable brute force search - #7
Open
c-i-njoroge wants to merge 5 commits into
Open
Conversation
c-i-njoroge
marked this pull request as ready for review
August 4, 2026 21:38
hicder-rddt
approved these changes
Aug 5, 2026
hicder-rddt
left a comment
Collaborator
There was a problem hiding this comment.
small nit, but LGTM
|
|
||
| // an explicit user request to force brute force overrides the heuristics below | ||
| const auto* hnsw_cfg = dynamic_cast<const BaseHnswConfig*>(&cfg); | ||
| if (hnsw_cfg != nullptr && hnsw_cfg->force_brute_force.has_value() && hnsw_cfg->force_brute_force.value()) { |
Collaborator
There was a problem hiding this comment.
Suggested change
| if (hnsw_cfg != nullptr && hnsw_cfg->force_brute_force.has_value() && hnsw_cfg->force_brute_force.value()) { | |
| if (hnsw_cfg != nullptr && hnsw_cfg->force_brute_force.value_or(true)) { |
Collaborator
Author
There was a problem hiding this comment.
Wouldn't we want this to be false? Basically if the field doesn't exist then the user did not intend to enable brute force
Comment on lines
+45
to
+46
| LOG_KNOWHERE_INFO_ << "force_brute_force enabled: bypassing HNSW graph traversal for exhaustive search (k=" | ||
| << cfg.k.value() << ", ntotal=" << index->ntotal << ")"; |
Collaborator
There was a problem hiding this comment.
we may not want to log info for every request. maybe debug?
Collaborator
Author
There was a problem hiding this comment.
This is only when brute force is enabled with the flag. I can set to debug after some more testing
Comment on lines
+1471
to
+1473
| LOG_KNOWHERE_INFO_ << "force_brute_force: completed exhaustive search for " << rows | ||
| << " queries (k=" << k << ", ntotal=" << indexes[index_id]->ntotal | ||
| << ", used_bf_wrapper=" << whether_bf_search.value_or(false) << ")"; |
Collaborator
There was a problem hiding this comment.
maybe debug? but up to you
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
💸 TL;DR
Allow us to enable brute force searches so we can measure recall against the source of truth
📜 Details
Design Doc
Jira
🧪 Testing Steps / Validation
✅ Checks