[8.4] MOD-13885: Fix FT.HYBRID VSIM RANGE + FILTER returning zero results#8258
Merged
redisearch-backport-pull-request[bot] merged 1 commit into8.4from Feb 3, 2026
Merged
Conversation
4 tasks
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 8.4 #8258 +/- ##
==========================================
- Coverage 85.46% 85.41% -0.05%
==========================================
Files 335 335
Lines 52989 52997 +8
Branches 11000 11000
==========================================
- Hits 45287 45270 -17
- Misses 7559 7584 +25
Partials 143 143
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:
|
nafraf
approved these changes
Feb 3, 2026
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
Backport of #8205 to
8.4.Describe the changes in the pull request
A clear and concise description of what the PR is solving, including:
When the document insertion order doesn't match the score order returned by the vector RANGE query, the query returns no results instead of the expected matches.
Root Cause
SkipTorequires child iterators to be sorted by document ID.We implemented a conditional approach based on whether an explicit FILTER clause is provided:
BY_IDordering (required for intersection iterator compatibility)BY_SCOREordering and skip filter integration so the vector node becomes the root directlytest_hybrid_vector_range_with_filterwas failing if the docs were ingested in different order of the vector results, now it works independent of ingestion order.Which additional issues this PR fixes
Main objects this PR modified
Mark if applicable
Release Notes
If a release note is required (bug fix / new feature / enhancement), describe the user impact of this PR in the title.
Note
Medium Risk
Changes hybrid vector RANGE query planning/ordering and AST integration logic, which can affect correctness of filtered and unfiltered VSIM results. Risk is mitigated by expanded C++ and Python tests covering filtered/unfiltered RANGE across different document insertion orders.
Overview
Fixes
FT.HYBRIDVSIM RANGEqueries returning wrong/empty results when combined withFILTER.RANGEnow usesBY_IDordering only when an explicitFILTERis provided (so intersection/SkipToworks), whileRANGEwithout an explicit filter keepsBY_SCOREordering by skipping filter integration and making the vector node the AST root.Also avoids parsing the implicit wildcard query (
"*") when filter integration is skipped, and updates/extends C++ and Python tests to validate ordering and correctness regardless of document ingestion order.Written by Cursor Bugbot for commit 741ce8f. This will update automatically on new commits. Configure here.