Multi Vector > 10000 documents throws scoring error
维护者通常 4 天内回复
还没有人认领这个 Issue。
- #574 来自 @JiwaniZakir —— 已关闭,未合并
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 38/100
调研方向
首先使用超过 10,000 个文档,通过 MultiVectorQuery 和 SearchIndex.query 重现该示例,然后跟踪向量分数是如何组装并传递给 RediSearch 的。将失败的情况与 <=10,000 个文档的情况以及引用的 case() workaround 进行比较。当文档数量较大时,查询能够返回结果且不会出现缺失的 distance_1 scoring error,即表示完成。
由索引模型根据 Issue 内容生成。
描述
To reproduce:
from redisvl.query import MultiVectorQuery, Vector
from redisvl.index import SearchIndex
from redisvl.schema import IndexSchema
import numpy as np
from redis import Redis
client = Redis(host="localhost", port=6379, decode_responses=True)
test_index = SearchIndex(
IndexSchema.from_dict(
{
"index": {
"name": "idx:test",
"prefix": "test:",
"storage_type": "json",
},
"fields": [
{"name": "id", "type": "numeric"},
{
"name": "embedding_1",
"type": "vector",
"attrs": {
"dims": 512,
"distance_metric": "cosine",
"algorithm": "hnsw",
"datatype": "float32",
},
},
{
"name": "embedding_2",
"type": "vector",
"attrs": {
"dims": 512,
"distance_metric": "cosine",
"algorithm": "hnsw",
"datatype": "float32",
},
},
],
},
),
client,
validate_on_load=True,
)
test_index.create(overwrite=True)
TEST_DOCS_COUNT = 10001
test_data = [
{
"id": i,
"embedding_1": np.random.rand(512),
"embedding_2": np.random.rand(512),
}
for i, _ in enumerate(range(TEST_DOCS_COUNT))
]
test_index.load(test_data)
embedding_1 = np.random.rand(512)
embedding_2 = np.random.rand(512)
query_vectors = [
Vector(
vector=embedding_1,
field_name="embedding_1",
dtype="float32",
weight=0.7,
),
Vector(
vector=embedding_2,
field_name="embedding_2",
dtype="float32",
weight=0.2,
),
]
query = MultiVectorQuery(
vectors=query_vectors,
num_results=10,
return_fields=["id"],
)
results = test_index.query(query)
print(results)
With a TEST_DOCS_COUNT > 10,000 redis throws:
Error while aggregating: Could not find the value for a parameter name, consider using EXISTS if applicable for distance_1
<=10,000 works fine. I assume this is to do with the same logic that sets the max offset to 10,000 by default.
The workaround I'm using for now is the unstable feature case() to assign defaults for missing scores.
Is RediSearch limited by some design constraint to this number? Seems low for many applications of vector search, or maybe I'm missing something.
- 主要语言
- Python
- 星标
- 432
- 派生
- 116
- 平均合并
- 5 天 22 小时
- 30 天内合并 PR
- 13
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
redis/redis-vl-python 的其他 Issue
-
from_existing fails on SVS-VAMANA indexes created without compression可能已有人在做 @itsrayeedscodespace 于 2 天前认领。 未关闭bug index
难度 2/5 1-3 小时 新手友好度 84/100
redis/redis-vl-python#787 ·
维护者通常 4 天内回复
-
RedisVL warnings are never shown when the application has not configured logging可能已有人在做 @hippi345 于 2 天前认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 77/100
redis/redis-vl-python#786 ·
维护者通常 4 天内回复
-
exists() depends on exact FT.INFO error wording; an unrecognised "missing index" message makes create() never create the index (regression from #672)可能重新可做 关联的 PR 已关闭且未合并。 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
redis/redis-vl-python#773 · 1 条评论 ·
维护者通常 4 天内回复
-
Vector field with index_missing=True cannot be created可能已有人在做 @RaphaelFakhri 于 12 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
redis/redis-vl-python#770 ·
维护者通常 4 天内回复
-
Add Python 3.15 support可能已有人在做 @vishal-bala 于 13 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 65/100
redis/redis-vl-python#757 · 1 条评论 · 1 个 reaction ·
维护者通常 4 天内回复
查看 redis/redis-vl-python 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
ComposioHQ/awesome-claude-skills#2398 ·
维护者通常 2 天内回复
-
bug converter
难度 2/5 1-3 小时 新手友好度 62/100
grafana/sigma-rule-deployment#435 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 73/100
datamodel-code-generator/datamodel-code-generator#5589 ·
维护者通常 1 天内回复
-
Shell: serve the home app's Cookie Policy on a hard reload可能已有人在做 @2001anshkaushik 今天认领。 未关闭feature module:ai
难度 2/5 1-3 小时 新手友好度 88/100
rocketride-org/rocketride-server#2899 · 1 条评论 ·
维护者通常 2 天内回复
-
GEFSv12
难度 2/5 1-3 小时 新手友好度 70/100