Skip to content

fix(schema): emit INDEXMISSING after the vector attribute block - #771

Open
RaphaelFakhri wants to merge 1 commit into
redis:mainfrom
RaphaelFakhri:fix-vector-index-missing
Open

RaphaelFakhri wants to merge 1 commit into
redis:mainfrom
RaphaelFakhri:fix-vector-index-missing

Conversation

@RaphaelFakhri

@RaphaelFakhri RaphaelFakhri commented Oct 17, 2026 •

Copy link
Copy Markdown

Motivation

With index_missing: True on a vector field, SearchIndex.create() fails. field_data put "INDEXMISSING": True inside the vector attribute block, so redis-py raises Invalid input of type: 'bool', and the server rejects the token there anyway (Bad arguments for algorithm HNSW: INDEXMISSING). FT.CREATE expects INDEXMISSING after the attribute block, which is where redis-py places it for its index_missing keyword. The review on #742 described this failure.

Fixes #770.

Changes

  • redisvl/schema/fields.py: drop INDEXMISSING from BaseVectorFieldAttributes.field_data, and pass index_missing=self.attrs.index_missing to the redis-py VectorField in FlatVectorField, HNSWVectorField and SVSVectorField.as_redis_field(). This matches how the other field types handle the modifier.
  • tests/unit/test_fields.py: replace the test that asserted INDEXMISSING in field_data with a parametrized test (FLAT, HNSW, SVS-VAMANA) that checks INDEXMISSING follows the attribute block in redis_args().
  • tests/integration/test_field_modifier_ordering_integration.py: create FLAT and HNSW indexes with a vector index_missing field and check that ismissing(@embedding) returns only the document without the vector.

from_existing still doesn't recover index_missing on vector fields (see the comment in tests/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: true can now be created, and ismissing(@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 c5213f9 by Claude Code (Claude Opus 5.5) with pre-pr-review.
Lenses: correctness (always); tests (adds unit and integration tests); Redis behaviour (changes where FT.CREATE gets INDEXMISSING). Skipped: security (no query-building, MCP or destructive paths); design (small fix, no API change); docs (no docs or docstrings change).

  • 3 findings raised, 0 kept after challenge.
  • Fixed: none.
  • Rejected: removing INDEXMISSING from field_data could break a caller that reads it (no caller outside fields.py reads field_data); the index_missing keyword might not exist on the redis-py floor (redis-py 6.3.0 accepts it and emits INDEXMISSING after 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).
  • Open for the reviewer: none.

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 with fields.py from main (5 failed, the new cases); pytest tests/unit --ignore=tests/unit/test_mcp (1345 passed, 1 skipped); make check-types (no issues); black and isort --profile black on 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.

Copilot AI balanced review requested due to automatic review settings October 17, 2026 21:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@vishal-bala

Copy link
Copy Markdown
Collaborator

Hi, thanks for your contribution! Can you rebase onto the latest origin/main and follow the new contribution process?

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.
Copilot AI balanced review requested due to automatic review settings October 22, 2026 16:08
@RaphaelFakhri
RaphaelFakhri force-pushed the fix-vector-index-missing branch from 723e8b1 to c5213f9 Compare October 22, 2026 16:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@RaphaelFakhri

Copy link
Copy Markdown
Author

Rebased onto the latest main, and the description now follows the new template with a Review record for c5213f9.

This branch has not been deployed

No deployments
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.

Vector field with index_missing=True cannot be created

3 participants