Repository navigation
fix(schema): emit INDEXMISSING after the vector attribute block - #771
Open
RaphaelFakhri wants to merge 1 commit into
Open
RaphaelFakhri wants to merge 1 commit into
RaphaelFakhri wants to merge 1 commit into
Conversation
Collaborator
|
Hi, thanks for your contribution! Can you rebase onto the latest |
A vector field with index_missing=True put INDEXMISSING into the
algorithm attribute dict, so create() failed with "Invalid input of
type: 'bool'", and the server rejects the token inside the attribute
block anyway ("Bad arguments for algorithm"). Pass index_missing to the
redis-py VectorField instead, which appends INDEXMISSING after the block
as FT.CREATE expects.
RaphaelFakhri
force-pushed
the
fix-vector-index-missing
branch
from
October 22, 2026 16:08
723e8b1 to
c5213f9
Compare
Author
|
Rebased onto the latest |
This branch has not been deployed
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.
Motivation
With
index_missing: Trueon a vector field,SearchIndex.create()fails.field_dataput"INDEXMISSING": Trueinside the vector attribute block, so redis-py raisesInvalid input of type: 'bool', and the server rejects the token there anyway (Bad arguments for algorithm HNSW: INDEXMISSING).FT.CREATEexpectsINDEXMISSINGafter the attribute block, which is where redis-py places it for itsindex_missingkeyword. The review on #742 described this failure.Fixes #770.
Changes
redisvl/schema/fields.py: dropINDEXMISSINGfromBaseVectorFieldAttributes.field_data, and passindex_missing=self.attrs.index_missingto the redis-pyVectorFieldinFlatVectorField,HNSWVectorFieldandSVSVectorField.as_redis_field(). This matches how the other field types handle the modifier.tests/unit/test_fields.py: replace the test that assertedINDEXMISSINGinfield_datawith a parametrized test (FLAT, HNSW, SVS-VAMANA) that checksINDEXMISSINGfollows the attribute block inredis_args().tests/integration/test_field_modifier_ordering_integration.py: create FLAT and HNSW indexes with a vectorindex_missingfield and check thatismissing(@embedding)returns only the document without the vector.from_existingstill doesn't recoverindex_missingon vector fields (see the comment intests/unit/test_convert_index_info.py). That can follow separately now that the field can be recreated.Release Notes
Vector fields declared with
index_missing: truecan now be created, andismissing(@field)queries work on them.Review record
This change was written with Claude Code (Claude Opus 5.5) and reviewed by a human before submission.
Reviewed at
c5213f9by Claude Code (Claude Opus 5.5) withpre-pr-review.Lenses: correctness (always); tests (adds unit and integration tests); Redis behaviour (changes where
FT.CREATEgetsINDEXMISSING). Skipped: security (no query-building, MCP or destructive paths); design (small fix, no API change); docs (no docs or docstrings change).INDEXMISSINGfromfield_datacould break a caller that reads it (no caller outsidefields.pyreadsfield_data); theindex_missingkeyword might not exist on the redis-py floor (redis-py 6.3.0 accepts it and emitsINDEXMISSINGafter the block, checked directly); SVS-VAMANA has no integration case (the unit test covers its argument order, and the code path is shared with FLAT and HNSW).Verified:
pytest tests/unit/test_fields.py tests/integration/test_field_modifier_ordering_integration.py tests/unit/test_convert_index_info.py(85 passed, Redis 8.4); same two test files withfields.pyfrommain(5 failed, the new cases);pytest tests/unit --ignore=tests/unit/test_mcp(1345 passed, 1 skipped);make check-types(no issues);blackandisort --profile blackon the changed files (no changes).Docs consulted: https://redis.io/docs/latest/commands/ft.create/
Not checked: cluster mode; SVS-VAMANA against a live server; Redis versions other than 8.4.