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

What

Vector fields now pass index_missing to the redis-py VectorField constructor instead of adding INDEXMISSING to the algorithm attribute dict.

Why

With index_missing: True on a vector field, SearchIndex.create() fails. field_data put "INDEXMISSING": True inside the attribute block, so the client 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 block, which is where redis-py places it for the 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 in FlatVectorField, HNSWVectorField and SVSVectorField.as_redis_field().
  • 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 does not 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.

Testing

  • On main, the 5 new test cases fail (DataError: Invalid input of type: 'bool' for the integration cases). With this change, tests/unit/test_fields.py and tests/integration/test_field_modifier_ordering_integration.py give 72 passed against redis:8.4.
  • tests/unit (without test_mcp) gives the same result as on main, apart from the 2 added cases. The only failures are the existing test_repr and google_genai optional-dependency ones.
  • black, isort and mypy redisvl pass.

Note

Medium Risk
Touches vector index schema serialization for all algorithms; wrong ordering would break index creation, but behavior is narrowly scoped to the index_missing flag with added regression tests.

Overview
Vector index_missing now emits INDEXMISSING in the correct place for FT.CREATE, so indexes with missing-vector search can be created again.

Previously INDEXMISSING was stuffed into the vector algorithm attribute dict (field_data), which broke redis-py (Invalid input of type: 'bool') and Redis (Bad arguments for algorithm …: INDEXMISSING). The change removes it from BaseVectorFieldAttributes.field_data and passes index_missing into the redis-py VectorField constructor for FLAT, HNSW, and SVS-VAMANA, matching how lexical fields handle the modifier (token after the attribute block).

Tests were updated: a parametrized unit test asserts INDEXMISSING is not inside the counted attribute block but appears in redis_args() suffix; integration tests cover FLAT/HNSW indexes and ismissing(@embedding) queries.

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

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 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?

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