Skip to content

Support the KNN shard-ratio feature#494

Open
mgravell wants to merge 6 commits into
masterfrom
marc/ft-hybrid-ratio
Open

Support the KNN shard-ratio feature#494
mgravell wants to merge 6 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
Adds a new KNN query parameter and adjusts public API signatures/argument serialization; incorrect token counting or version gating could break hybrid search queries against Redis servers that don’t support the option.

Overview
Adds support for RedisSearch 8.6.1+ KNN SHARD_K_RATIO by extending VectorSearchMethod.NearestNeighbour with an optional shardRatio that serializes to SHARD_K_RATIO and updates KNN token counting.

Updates the public API surface (keeps a binary-compat overload), expands unit/integration tests with new shard-ratio scenarios, and enhances test skip/version logic to allow deferring xUnit skip evaluation and optionally overriding the minimum Redis version per scenario. Also updates the Docker test image default to a custom 8.8 build.

Reviewed by Cursor Bugbot for commit a2898de. 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
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