Skip to content

Glossary filter missing terms#804

Draft
cursor[bot] wants to merge 2 commits intomainfrom
LINTEST-409
Draft

Glossary filter missing terms#804
cursor[bot] wants to merge 2 commits intomainfrom
LINTEST-409

Conversation

@cursor
Copy link

@cursor cursor bot commented Feb 11, 2026

✨ 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 the minimum_should_match value when combining queries, ensuring tag filters remain required.

Jira link: LINTEST-409


🧩 Type of change

Select all that apply:

  • 🚀 New feature (non-breaking change that adds functionality)
  • 🐛 Bug fix (non-breaking change that fixes an issue) — please include tests! Refer testing-toolkit 🧪
  • 🔄 Refactor (code change that neither fixes a bug nor adds a feature)
  • 🧹 Maintenance (chores, cleanup, minor improvements)
  • 💥 Breaking change (fix or feature that may break existing functionality)
  • 📦 Dependency upgrade/downgrade
  • 📚 Documentation updates

✅ How has this been tested? (e.g. screenshots, logs, workflow links)

  • Added 3 new unit tests (test_bool_add_preserves_minimum_should_match, test_bool_add_reverse_order, test_bool_add_max_minimum_should_match) to tests/unit/test_search_model.py to specifically cover the fix and prevent regression.
  • All existing 234 unit tests pass.
  • Verified the fix works correctly with both forward and reverse query combinations.

📋 Checklist

  • My code follows the project’s style guidelines
  • I’ve performed a self-review of my code
  • I’ve added comments in tricky or complex areas
  • I’ve updated the documentation as needed
  • There are no new warnings from my changes
  • I’ve added tests to cover my changes
  • All new and existing tests pass locally

Open in Cursor Open in Web

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.
@cursor
Copy link
Author

cursor bot commented Feb 11, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

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.

1 participant