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

v6: rerank score is never unmarshalled from the search reply

未关闭
#604 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
74/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
java

调研方向

追踪 client6 API 和内部 ORM 包中的 QueryResponse 反序列化器,从现有的 distance、certainty、score 和 explainScore 读取逻辑开始。检查 QueryMetadata 和 QueryResponseGroup,以及 MetadataResult 和 GroupByResult.rerank。完成的标准是,包含显式存在性处理的 rerank 分数可通过公共对象 API 和分组结果 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

贡献指南

这个仓库没有索引到贡献指南

从这里开始

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

weaviate/java-client 的其他 Issue

查看 weaviate/java-client 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

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