Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Multi Vector > 10000 documents throws scoring error

オープン
#480 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 5 日以内に返信

まだ誰も着手していません。

  • #574 @JiwaniZakir による — マージされずにクローズ

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
38/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
numpy, python, redis

調査の方向性

まず、10,000件を超えるドキュメントを使って、MultiVectorQuery と SearchIndex.query 経由で例を再現し、その後、ベクトルスコアがどのように組み立てられて RediSearch に渡されるかを追跡します。失敗するケースを、<=10,000件のドキュメントの場合および参照されている case() の回避策と比較します。より多いドキュメント数でも、missing distance_1 scoring error が発生せずクエリが結果を返せば完了です。

索引モデルが issue の本文から書いたものです。

説明

bug query

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
スター
431
フォーク
107
平均マージ
5日 17時間
マージ済み PR(30日)
16

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

redis/redis-vl-python のほかの issue

redis/redis-vl-python の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。