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

v6: rerank score is never unmarshalled from the search reply

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

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

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
74/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
java

調査の方向性

client6 API と内部 ORM パッケージにおける QueryResponse のデシリアライザーを、distance、certainty、score、explainScore の既存の読み取りから追跡します。QueryMetadata と QueryResponseGroup を、MetadataResult および GroupByResult.rerank と併せて調査します。完了条件は、明示的な存在処理を含む rerank スコアが、public object API と grouped-result API の両方から利用できることです。

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

説明

Summary

The server returns a rerank score per object (and per group for a grouped search), but the client never unmarshals it. A reranked search therefore arrives correctly ordered with the number that produced the order missing, and there is no way to get it through the public API.

Per object

MetadataResult carries both the value and an explicit presence flag:

double rerank_score = 21;
bool   rerank_score_present = 22;

but QueryMetadata exposes only four fields:

public final class QueryMetadata extends Record {
    public Float  distance();
    public Float  certainty();
    public Float  score();
    public String explainScore();
}

Per group

Same thing on the grouped path. GroupByResult.rerank is a RerankReply { double score = 1; }, while QueryResponseGroup exposes only:

public String name();
public Float  minDistance();
public Float  maxDistance();
public long   numberOfObjects();
public List<QueryObjectGrouped<T>> objects();

The field is never read

Extracting io/weaviate/client6/v1/api/** and io/weaviate/client6/v1/internal/orm/** from client6-6.3.1-all.jar and grepping for rerankScore, getRerankScore and RerankReply returns zero matches. Disassembling the QueryResponse unmarshaller shows it reading getCreationTimeUnix, getLastUpdateTimeUnix, getDistance, getCertainty, getScore and getExplainScore — and nothing else.

The server does populate it

Wrapping the Rpc returned by QueryRequest.rpc(...) and reading MetadataResult off the reply before delegating to the real unmarshal yields real values, correlated by uuid — querying "fish" over a set of animal descriptions with reranker-cohere:

0.781147420  The fish is an aquatic animal that lives ...
0.051658671  The dog is a very popular domestic anima ...
0.050354082  The lion is a wild and majestic animal,  ...

The row order matches the score descending, which is exactly the ordering the server applied — so the data is present on the reply and simply discarded.

Impact

Without this, a client cannot show or threshold on the rerank score, or explain the resulting order. The only workaround is to reach into GrpcTransport/QueryRequest internals and re-read the reply, which is not something a consumer should have to do.

Suggested fix

Add a rerankScore component to QueryMetadata (honouring rerank_score_present, since 0.0 is a legitimate score) and read it in the QueryResponse unmarshaller. The same for QueryResponseGroup from GroupByResult.rerank.

Version

  • java-client 6.3.1 (also present in 6.3.0)
  • Weaviate 1.39.0
主要言語
Java
スター
34
フォーク
30
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

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

weaviate/java-client のほかの issue

weaviate/java-client の issue をすべて見る

似ている issue

Java の issue をもっと見る

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

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