Repository navigation
Fix FT.HYBRID COMBINE argument count to include YIELD_SCORE_AS tokens - #4575
Merged
Merged
Conversation
Combiner.addParams wrote the COMBINE <method> <count> using only the method-specific tokens (WINDOW/CONSTANT/ALPHA/BETA). When a combined-score alias was set via .as(...), the two appended YIELD_SCORE_AS <alias> tokens fell outside that count, so Redis read past the clause and rejected the command with "YIELD_SCORE_AS: Unknown argument". Count the two alias tokens when an alias is present. The fix lives in the shared final addParams, so it covers both RRF and LINEAR combiners. Add CombinersTest with protocol-level serialization coverage for both combiners (each parameter alone and combined, plus the empty default) and the YIELD_SCORE_AS alias cases that regress this bug. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Hi, I’m Jit, a friendly security platform designed to help developers build secure applications from day zero with an MVS (Minimal viable security) mindset. In case there are security findings, they will be communicated to you as a comment inside the PR. Hope you’ll enjoy using Jit. Questions? Comments? Want to learn more? Get in touch with us. |
ggivo
added a commit
that referenced
this pull request
Jun 26, 2026
…ORE_AS (#4576) Fix FT.HYBRID COMBINE argument count to include YIELD_SCORE_AS tokens (#4575) * Fix FT.HYBRID COMBINE arg count to include YIELD_SCORE_AS tokens Combiner.addParams wrote the COMBINE <method> <count> using only the method-specific tokens (WINDOW/CONSTANT/ALPHA/BETA). When a combined-score alias was set via .as(...), the two appended YIELD_SCORE_AS <alias> tokens fell outside that count, so Redis read past the clause and rejected the command with "YIELD_SCORE_AS: Unknown argument". Count the two alias tokens when an alias is present. The fix lives in the shared final addParams, so it covers both RRF and LINEAR combiners. Add CombinersTest with protocol-level serialization coverage for both combiners (each parameter alone and combined, plus the empty default) and the YIELD_SCORE_AS alias cases that regress this bug. * test: add FT.HYBRID YIELD_SCORE_AS integration test for RRF and LINEAR * format --------- (cherry picked from commit 7fdb4e4) Co-authored-by: Guy Royse <guy@guy.dev>
mergify Bot
added a commit
to ArcadeData/arcadedb
that referenced
this pull request
Jul 1, 2026
Bumps [redis.clients:jedis](https://github.com/redis/jedis) from 7.5.2 to 7.5.3. Release notes *Sourced from [redis.clients:jedis's releases](https://github.com/redis/jedis/releases).* > 7.5.3 > ----- > > This is a maintenance release with fixes for FT.HYBRID queries and connection pool handshake overhead. Recommended for any deployment using FT.HYBRID with `Combiner.as(...)` or `MultiDbClient`. > > 🐛 Bug Fixes > ----------- > > * Fixes `FT.HYBRID` `COMBINE` argument count omitting `YIELD_SCORE_AS` tokens, causing the command to be rejected when a combined-score alias is set via `Combiner.as(...)`. Fix by [`@guyroyse`](https://github.com/guyroyse) in [redis/jedis#4575](https://redirect.github.com/redis/jedis/pull/4575), backported to `7.5.x` in [redis/jedis#4576](https://redirect.github.com/redis/jedis/pull/4576). > * Fixes double initialization of a pooled `Connection` in `TrackingConnectionPool` (used by `MultiDbClient`). [redis/jedis#4547](https://redirect.github.com/redis/jedis/pull/4547), backported to `7.5.x` in <redis/jedis@dd42b3e>. > > **Full Changelog**: <redis/jedis@v7.5.2...v7.5.3> Commits * [`d0ca056`](redis/jedis@d0ca056) Add Redis 8.8 GA to test matrix on 7.5.x ([#4578](https://redirect.github.com/redis/jedis/issues/4578)) * [`2e73f17`](redis/jedis@2e73f17) Backport [#4571](https://redirect.github.com/redis/jedis/issues/4571) and [#4573](https://redirect.github.com/redis/jedis/issues/4573) to 7.5.x: stabilize XINFO STREAM tests ([#4577](https://redirect.github.com/redis/jedis/issues/4577)) * [`458bccf`](redis/jedis@458bccf) Backport [#4575](https://redirect.github.com/redis/jedis/issues/4575) to 7.5.x: fix FT.HYBRID COMBINE arg count for YIELD\_SCORE\_AS (... * [`dd42b3e`](redis/jedis@dd42b3e) [7.5] Backport [#4547](https://redirect.github.com/redis/jedis/issues/4547): Fix double initialization of pooled Connection in Track... * See full diff in [compare view](redis/jedis@v7.5.2...v7.5.3) [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- Dependabot commands and options You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
4 tasks done
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.
Problem
Combiner.addParamsserializes theCOMBINE <method> <count>clause using only the method-specific tokens (WINDOW/CONSTANT/ALPHA/BETA). When a combined-score alias is set via.as(...), the appendedYIELD_SCORE_AS <alias>tokens fall outside that count, so Redis reads past the clause and rejects the command withYIELD_SCORE_AS: Unknown argument. Any hybrid query setting a combined-score alias fails.For example,
Combiners.rrf().window(20).constant(60).as("score")emitted:when Redis expects the count to cover all six following tokens:
Fix
Include the two
YIELD_SCORE_AS <alias>tokens in the count when an alias is present. SinceaddParamsisfinalon the shared baseCombiner, this covers both RRF and LINEAR combiners.Tests
Adds
CombinersTestwith protocol-level serialization coverage for both combiners — each parameter alone and combined, the empty default, and theYIELD_SCORE_ASalias cases that regress this bug. Follows the existingCommandArgumentsMatchersidiom (hasArgumentCount/hasArguments). Verified the existingFTHybridRedisClientCommandsITstill passes against a live Redis.Introduced by #4405.
Fixes #4574
Note
Low Risk
Small, targeted fix to search command serialization with broad unit and integration test coverage; no auth, data, or API contract changes beyond correcting broken hybrid queries that use
.as(...).Overview
Fixes FT.HYBRID hybrid queries that set a combined-score alias via
Combiner.as(...). Redis expects theCOMBINE <method> <count>count to cover every token in the clause, includingYIELD_SCORE_ASand the alias; the client previously counted only method-specific args, so Redis treated those tokens as unknown arguments and rejected the command.Combiner.addParamsnow adds 2 to the clause count when a score alias is present, so both LINEAR and RRF combiners serialize correctly.Adds
CombinersTestfor command serialization (defaults, parameters, and alias cases) and a parameterized integration test inFTHybridCommandsTestBasethat asserts the combined score is returned under the alias.Reviewed by Cursor Bugbot for commit 1179422. Bugbot is set up for automated code reviews on this repo. Configure here.