Repository navigation
Conversation
The conversion picked the match type from the value's content: a String
with whitespace became MatchValue::Text, a full-text match, and any other
became MatchValue::Keyword, an exact match. Condition::matches("color",
"Light Orange".to_string()) therefore sent a different filter than
Condition::matches("color", "Orange".to_string()), with nothing at the
call site to say so.
Remove the conversion, so a single string has to name its match:
Condition::matches_keyword for an exact keyword (new, alongside the
existing matches_text, matches_phrase, matches_prefix, ...) or
Condition::matches_text for full text. A compile_fail doc test pins that
Condition::matches no longer takes a String. The other conversions (bool,
i64, Vec<i64>, Vec<String>, [&str; N]) are unchanged.
Callers in docs, tests and snippets move to matches_keyword, and the
integration test asserting the whitespace heuristic is removed; the
matches_text assertion next to it still covers full-text matching.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
From<String> for MatchValuepicks the match type from the value: a string with whitespace becomes a full-textTextmatch, anything else an exactKeyword. SoCondition::matches("color", "Light Orange".to_string())silently sends a different filter than"Orange". This bit bfb's dataset mode (qdrant/bfb#193).This PR removes the conversion and adds
Condition::matches_keyword, so callers pickmatches_keywordormatches_textexplicitly. Acompile_faildoc test pins it. The other conversions are unchanged.Breaking:
Condition::matches(field, some_string)no longer compiles. Usematches_keyword(field, "..."), which is what whitespace-free values already got. #86 tried making the conversion alwaysKeywordand reverted it for compatibility; a compile error is safer than a silent change. The qdrant/api-reference Rust snippets need the same update.Tested: build, fmt, clippy
-D warnings, 119 doc tests. Integration tests are left to CI.🤖 Generated with Claude Code