MOD-11858: Support subquery count in FT.HYBRID#7770
Merged
Itzikvaknin merged 6 commits intomasterfrom Dec 22, 2025
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7770 +/- ##
==========================================
- Coverage 84.11% 84.05% -0.07%
==========================================
Files 360 360
Lines 56242 56289 +47
Branches 15686 15717 +31
==========================================
+ Hits 47310 47315 +5
- Misses 8715 8758 +43
+ Partials 217 216 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
kei-nan
reviewed
Dec 15, 2025
kei-nan
reviewed
Dec 15, 2025
kei-nan
reviewed
Dec 15, 2025
kei-nan
requested changes
Dec 15, 2025
nafraf
reviewed
Dec 16, 2025
to unsigned int subqueriesCount = 0; Change "HYBRID supports only 2 subqueries" to "FT.HYBRID currently supports only two subqueries"
kei-nan
reviewed
Dec 22, 2025
kei-nan
reviewed
Dec 22, 2025
kei-nan
reviewed
Dec 22, 2025
kei-nan
approved these changes
Dec 22, 2025
nafraf
approved these changes
Dec 22, 2025
Contributor
|
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin 8.4
git worktree add -d .worktree/backport-7770-to-8.4 origin/8.4
cd .worktree/backport-7770-to-8.4
git switch --create backport-7770-to-8.4
git cherry-pick -x fd91054d72b5c9d270ce89c40db891e92b78b78e |
Itzikvaknin
added a commit
that referenced
this pull request
Dec 22, 2025
* Support subquery count (currently only 2) in FT.HYBRID, remain backward compatible * Add comment on error massage and simplify if statement * Newline EOF * Change unsigned long long subqueries_count to unsigned int subqueriesCount = 0; Change "HYBRID supports only 2 subqueries" to "FT.HYBRID currently supports only two subqueries" * Consolidate hybrid subqueries count logic and move it to a different name
This was referenced Dec 22, 2025
github-merge-queue bot
pushed a commit
that referenced
this pull request
Dec 22, 2025
) (#7862) * MOD-11858: Support subquery count in FT.HYBRID (#7770) * Support subquery count (currently only 2) in FT.HYBRID, remain backward compatible * Add comment on error massage and simplify if statement * Newline EOF * Change unsigned long long subqueries_count to unsigned int subqueriesCount = 0; Change "HYBRID supports only 2 subqueries" to "FT.HYBRID currently supports only two subqueries" * Consolidate hybrid subqueries count logic and move it to a different name * Updated error codes in parseSubqueriesCount to use the older concise version.
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.
Describe the changes in the pull request
Add support for subquery count in FT.HYBRID - preparation for future multiple (>2) subqueries support.
A clear and concise description of what the PR is solving, including:
Current:
Only
FT.HYBRID SEARCH <search_query> VSIM <vector_query>is valid.Change:
Both
FT.HYBRID SEARCH <search_query> VSIM <vector_query>andFT.HYBRID count SEARCH <search_query> VSIM <vector_query>are valid.Currently, only two subqueries are supported, and they must appear in the order:
SEARCHfirst,VSIMsecond.This PR sets up the syntax needed to support multiple subqueries in the future.
Outcome:
FT.HYBRID 2 SEARCH <search_query> VSIM <vector_query>is a valid syntax.Which additional issues this PR fixes
Main objects this PR modified
Mark if applicable
Note
Add parsing of an optional subqueries count after the index in FT.HYBRID (currently must be
2), adjusting errors and tests, and updating Python helper to emit the new syntax.src/hybrid/parse_hybrid.c):parseSubqueriesCountto handle optional<subqueries_count>after index inFT.HYBRID; requireSEARCHafter the count; enforceHYBRID_REQUEST_NUM_SUBQUERIES(2); preserve old format by acceptingSEARCHwhen count is absent.parseHybridCommandand update error flows/messages accordingly.tests/cpptests/test_cpp_parse_hybrid.cpp):SEARCHto reflect invalid/missing subqueries count.SEARCHafter count).tests/pytests/utils/hybrid.py):translate_hybrid_queryto emitFT.HYBRID <index> 2 ....Written by Cursor Bugbot for commit acbb7c4. This will update automatically on new commits. Configure here.