Repository navigation
Conversation
`FieldCondition::check_empty()` ignored the `values_count` condition, so a point with a missing payload field was never matched by a `values_count` filter. The desired semantics (and the existing `ValuesCount::check_empty`) treat a missing field as having a value count of 0. Forward the empty check to `values_count.check_empty()` so bounds like `lt: 1`, `gte: 0` and `lte: 0` correctly match points whose field is absent. Fixes #9586 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Contributor
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (3)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
generall
merged commit Jun 29, 2026
0ec699c
into
test/values-count-missing-field-9586
15 checks passed
generall
added a commit
that referenced
this pull request
Jun 29, 2026
…9606) * test: add openapi regression test for values_count on missing fields Reproduces #9586 where points with a missing payload field are not matched by values_count filters that should treat the count as 0. Co-authored-by: Cursor <[email protected]> * test: use module fixture for values_count missing field test Follow the standard openapi test structure with setup/teardown fixture instead of explicit drop_collection calls in the test body. Co-authored-by: Cursor <[email protected]> * fix: treat missing field as count 0 for values_count filter (#9607) `FieldCondition::check_empty()` ignored the `values_count` condition, so a point with a missing payload field was never matched by a `values_count` filter. The desired semantics (and the existing `ValuesCount::check_empty`) treat a missing field as having a value count of 0. Forward the empty check to `values_count.check_empty()` so bounds like `lt: 1`, `gte: 0` and `lte: 0` correctly match points whose field is absent. Fixes #9586 Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]> --------- Co-authored-by: Cursor <[email protected]> Co-authored-by: Andrey Vasnetsov <[email protected]> Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
generall
added a commit
that referenced
this pull request
Aug 4, 2026
…9606) * test: add openapi regression test for values_count on missing fields Reproduces #9586 where points with a missing payload field are not matched by values_count filters that should treat the count as 0. Co-authored-by: Cursor <[email protected]> * test: use module fixture for values_count missing field test Follow the standard openapi test structure with setup/teardown fixture instead of explicit drop_collection calls in the test body. Co-authored-by: Cursor <[email protected]> * fix: treat missing field as count 0 for values_count filter (#9607) `FieldCondition::check_empty()` ignored the `values_count` condition, so a point with a missing payload field was never matched by a `values_count` filter. The desired semantics (and the existing `ValuesCount::check_empty`) treat a missing field as having a value count of 0. Forward the empty check to `values_count.check_empty()` so bounds like `lt: 1`, `gte: 0` and `lte: 0` correctly match points whose field is absent. Fixes #9586 Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]> --------- Co-authored-by: Cursor <[email protected]> Co-authored-by: Andrey Vasnetsov <[email protected]> Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
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.
What
Fixes the
values_countfilter so a point whose payload field is missing is treated as having a value count of0, instead of never matching.Targets the regression-test branch
test/values-count-missing-field-9586(the test added there currently fails againstmaster).Root cause
FieldCondition::check_empty()inlib/segment/src/payload_storage/condition_checker.rsignored thevalues_countfield. When a point has no value for the queried key,check_field_condition()short-circuits tocheck_empty(), which returnedfalse— sovalues_countbounds were never evaluated for missing fields.Fix
Forward the empty check to the already-existing
ValuesCount::check_empty()(which evaluates the bounds against a count of0). Now:{"lt": 1}matches a missing field (0 < 1){"gte": 0}matches a missing field (0 >= 0){"lte": 0}matches a missing field (0 <= 0){"gte": 1}does not match a missing field (0 >= 1is false)Tests
test_value_count_missing_fieldunit test incondition_checker.rs.test_filter_values_count_missing_field.py(added on the base branch) pass.Fixes #9586
🤖 Generated with Claude Code