Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Vector field with index_missing=True cannot be created

未关闭 适合新手
#770 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 5 天内回复

@RaphaelFakhri 已经在做这个了。

开始于 2026年10月17日。

  • #771 来自 @RaphaelFakhri —— 未关闭

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
72/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
python, redis
领域
backend, databases

调研方向

Start by reading BaseVectorFieldAttributes.field_data and the vector field construction path used by SearchIndex.create(); compare that with how redis-py’s VectorField accepts index_missing=True on the field constructor. Check the existing vector field tests for HNSW, flat, and svs-vamana. Done means index creation succeeds with index_missing: True and ismissing(@emb) matches documents without the field.

由索引模型根据 Issue 内容生成。

描述

Description

A vector field declared with index_missing: True makes SearchIndex.create() fail. The same review thread on #742 noted this, and the from_existing parser skips INDEXMISSING on vector fields for this reason.

BaseVectorFieldAttributes.field_data adds "INDEXMISSING": True to the algorithm attribute dict. redis-py's VectorField counts and sends every dict entry inside the attribute block, so:

  1. The client rejects the Python bool before sending: Invalid input of type: 'bool'.
  2. Even as a string, the server rejects the token inside the block: Bad arguments for algorithm HNSW: INDEXMISSING.

FT.CREATE expects INDEXMISSING after the attribute block, which is where redis-py puts it when you pass index_missing=True to the field constructor.

Reproduction

Redis 8.4, redis-py 8.1.0, RedisVL main (e5d7598):

from redisvl.index import SearchIndex

schema = {
    "index": {"name": "im", "prefix": "im", "storage_type": "hash"},
    "fields": [
        {"name": "id", "type": "tag"},
        {"name": "emb", "type": "vector",
         "attrs": {"dims": 3, "algorithm": "hnsw", "index_missing": True}},
    ],
}
SearchIndex.from_dict(schema, redis_url="redis://localhost:6379").create()
redisvl.exceptions.RedisSearchError: Failed to create index 'im' on Redis:
Invalid input of type: 'bool'. Convert to a bytes, string, int or float first.

The same happens with flat and svs-vamana.

Expected behavior

The index is created with INDEXMISSING on the vector field, and ismissing(@emb) matches documents without the field.

主要语言
Python
星标
431
派生
107
平均合并
5 天 17 小时
30 天内合并 PR
16

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

redis/redis-vl-python 的其他 Issue

查看 redis/redis-vl-python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。