Skip to content

feat(search): add RERANK parameter for HNSW vector fields#3356

Open
nkaradzhov wants to merge 1 commit into
redis:masterfrom
nkaradzhov:hnsw-rerank
Open

feat(search): add RERANK parameter for HNSW vector fields#3356
nkaradzhov wants to merge 1 commit into
redis:masterfrom
nkaradzhov:hnsw-rerank

Conversation

@nkaradzhov

@nkaradzhov nkaradzhov commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

This pull request adds support for the RERANK parameter on HNSW vector field definitions in FT.CREATE, introduced in Redis 8.10 (RediSearch, for disk-based vector indexes).

  • New optional RERANK?: boolean on the HNSW schema vector field type.
  • When set, the client emits RERANK TRUE or RERANK FALSE as a key-value pair in the field definition.
  • No default value — the parameter is only sent when explicitly provided, matching the server contract where users must specify it for disk-based indexes.

The parameter is HNSW-only; FLAT and SVS-VAMANA are unaffected and the type narrowing makes RERANK a compile error on those algorithms. The value is passed through as-is, so MVP (TRUE-only) vs later (FALSE allowed) validation stays server-side.

Note: creating a disk-based vector index is a server capability and is not exposed as an FT.CREATE client flag, so the 8.10-gated live test asserts the parameter reaches the server and is recognized (rejected only for the index type, not as a syntax error).

🤖 Generated with Claude Code


Note

Low Risk
Opt-in schema serialization in the search client only; no changes to connection, auth, or existing index defaults.

Overview
Adds optional RERANK on HNSW vector fields in FT.CREATE (Redis 8.10 / disk-based indexes). When set, the client emits RERANK TRUE or RERANK FALSE; if omitted, nothing is sent.

Types limit RERANK to HNSW so FLAT and SVS-VAMANA schemas are unchanged. Tests cover argument transformation and a version-gated integration check that the server accepts the token (OSS tests expect a disk-based index rejection, not a syntax error).

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

Add the optional RERANK boolean to HNSW vector field definitions in
FT.CREATE, introduced in Redis 8.10 for disk-based vector indexes. When
set, the client emits `RERANK TRUE` / `RERANK FALSE`; it is only sent
when explicitly provided. The parameter is HNSW-only and confined to the
HNSW schema type.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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