Draft
Conversation
This fixes LINTEST-409 where glossary term searches combining tag filters (using should clauses) with custom metadata filters (using filter clauses) were missing expected terms. The issue was in the Bool.__add__ method which combines two Bool queries. When combining queries, if one had should clauses with minimum_should_match=1 (like tag filters) and the other had filter clauses (like metadata filters), the minimum_should_match value was not being preserved, causing the should clauses to become optional instead of required. This resulted in the _min_should_match property returning 0 when both should and filter clauses were present, making tag filters optional rather than required. Changes: - Modified Bool.__add__ to preserve minimum_should_match when combining queries - When both queries have minimum_should_match, uses the maximum value - Added unit tests to verify the fix and prevent regression This ensures that when filtering glossary terms by both tags and custom metadata, all terms matching BOTH conditions are returned as expected.
Author
|
Cursor Agent can help with this pull request. Just |
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.
✨ Description
Resolves an issue where glossary term searches with combined tag and custom metadata filters were missing expected terms (LINTEST-409). The
Bool.__add__method now correctly preserves theminimum_should_matchvalue when combining queries, ensuring tag filters remain required.Jira link: LINTEST-409
🧩 Type of change
Select all that apply:
✅ How has this been tested? (e.g. screenshots, logs, workflow links)
test_bool_add_preserves_minimum_should_match,test_bool_add_reverse_order,test_bool_add_max_minimum_should_match) totests/unit/test_search_model.pyto specifically cover the fix and prevent regression.📋 Checklist