Skip to content

Support the KNN shard-ratio feature#494

Merged
mgravell merged 8 commits into
masterfrom
marc/ft-hybrid-ratio
May 27, 2026
Merged

Support the KNN shard-ratio feature#494
mgravell merged 8 commits into
masterfrom
marc/ft-hybrid-ratio

Conversation

@mgravell
Copy link
Copy Markdown
Collaborator

@mgravell mgravell commented May 14, 2026

from 8.6.1, FT.HYBRID KNN has a new SHARD_K_RATIO feature: RediSearch/RediSearch#8227


Note

Medium Risk
Changes public search API and command serialization for vector KNN; behavior is additive but incorrect ratios could affect cluster search results.

Overview
Adds client support for RediSearch KNN SHARD_K_RATIO (Redis 8.6.1+) on hybrid vector search.

VectorSearchMethod.NearestNeighbour gains an optional shardRatio that serializes as SHARD_K_RATIO in KNN args. The previous (int count, int? maxCandidates) overload is kept without default parameters for binary compatibility; the richer overload (defaults, distanceAlias, shardRatio) lives in unshipped public API.

Tests defer env-based Redis skips via deferVersionCheck: true and gate shard-ratio scenarios at 8.6.1 through AssertVersion overrides. CI docker defaults move from 8.8-rc1 to 8.8.0.

Reviewed by Cursor Bugbot for commit 23d7538. Bugbot is set up for automated code reviews on this repo. Configure here.

@jit-ci
Copy link
Copy Markdown

jit-ci Bot commented May 14, 2026

🛡️ Jit Security Scan Results

CRITICAL HIGH MEDIUM

✅ No security findings were detected in this PR


Security scan by Jit

Comment thread tests/NRedisStack.Tests/SkipIfRedisTheoryAttribute.cs Outdated
Comment thread tests/NRedisStack.Tests/Search/HybridSearchUnitTests.cs Outdated
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit a2898de. Configure here.

Comment thread tests/dockers/docker-compose.yml Outdated
@mgravell mgravell mentioned this pull request May 26, 2026
@mgravell mgravell merged commit de7039f into master May 27, 2026
29 checks passed
@mgravell mgravell deleted the marc/ft-hybrid-ratio branch May 27, 2026 09:07
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