Skip to content

fix: preserve empty min_should filter semantics#9396

Open
Varunsls wants to merge 1 commit into
qdrant:devfrom
Varunsls:qdrant/9369-empty-min-should-conditions-with-min-count-0-is
Open

fix: preserve empty min_should filter semantics#9396
Varunsls wants to merge 1 commit into
qdrant:devfrom
Varunsls:qdrant/9369-empty-min-should-conditions-with-min-count-0-is

Conversation

@Varunsls

@Varunsls Varunsls commented Jun 9, 2026

Copy link
Copy Markdown

Fixes #9369.

Summary

  • Empty min_should clauses were removed during filter optimization.
  • This changed min_count > 0 from match-none to match-all.
  • The change preserves the clause so the optimized and plain filtering paths have identical semantics.

Testing

  • Regression coverage for min_count = 0 and min_count = 1
  • cargo test -p segment --lib
  • cargo test -p segment --test integration
  • cargo clippy -p segment --lib --tests -- -D warnings
  • cargo +nightly fmt --all -- --check

AI disclosure

Code reviewed by AI for any possible optimization.

@qdrant qdrant deleted a comment from coderabbitai Bot Jun 9, 2026
Comment on lines 78 to -79
}) = filter.min_should.as_ref()
&& !conditions.is_empty()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is valid.

An empty list with min_should == 0 (which is an accepted value) should still match everything.

I opened a PR at roughly the same time here: #9401

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants