Skip to content

Support the KNN shard-ratio feature#494

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

Support the KNN shard-ratio feature#494
mgravell wants to merge 3 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 that affects search execution and modifies the public API surface for VectorSearchMethod.NearestNeighbour, which could impact consumers and query behavior. Test skipping logic was also adjusted to defer version checks, which could hide/alter CI coverage if misused.

Overview
Adds support for Redis 8.6.1+ FT.HYBRID KNN SHARD_K_RATIO by extending VectorSearchMethod.NearestNeighbour with an optional shardRatio and emitting SHARD_K_RATIO in the generated argument list.

Updates the shipped/unshipped public API to reflect the new overload while retaining a binary-compat NearestNeighbour(int, int?) signature, and expands unit/integration tests to cover shard-ratio scenarios plus adds deferVersionCheck/overrideVersion paths to make version-based skips rely on detected server version.

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

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 2 potential issues.

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 2bab72c. Configure here.

Comment thread tests/NRedisStack.Tests/SkipIfRedisTheoryAttribute.cs Outdated
Comment thread tests/NRedisStack.Tests/Search/HybridSearchUnitTests.cs Outdated
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