Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

v6: rerank cannot be used with BM25, Hybrid or FetchObjects

Aperta Adatta ai principianti
#603 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
82/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
java
Ambito
api

Direzione di ricerca

Inizia con BaseVectorSearchBuilder e BaseQueryOptions.Builder, quindi esamina come Bm25.Builder, Hybrid.Builder e FetchObjects.Builder ereditano le rispettive opzioni. Controlla Rerank.appendTo(SearchRequest.Builder) e conferma che rerank sia esposto per questi operatori, preservando al contempo il comportamento near-search esistente; il lavoro è completato quando il client può inviare richieste di rerank BM25 e Hybrid attraverso il percorso gRPC esistente.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Summary

rerank(...) can only be attached to the near* search operators. BM25, Hybrid and FetchObjects cannot be reranked through the client, even though the server, the gRPC wire format and the other official clients all support it.

Where it comes from

rerank(Rerank) is declared on BaseVectorSearchBuilder:

abstract class BaseVectorSearchBuilder<SelfT, NearT> extends BaseQueryOptions.Builder<SelfT, NearT> {
    public SelfT rerank(Rerank);
    ...
}

so only NearText.Builder, NearVector.Builder, NearObject.Builder and the NearMediaBuilder family inherit it. Bm25.Builder, Hybrid.Builder and FetchObjects.Builder extend BaseQueryOptions.Builder, which has no rerank.

It is not a wire limitation

SearchRequest.rerank is a top-level proto field. Marshalling a plain BM25 search with the client's own code produces a request with hasRerank() == false — nothing sets it — but setting that single field and sending the result down the same GrpcTransport works:

client marshalled hasRerank=false
BM25+rerank over gRPC: rows=3 scores=3
   0.054848  The rabbit is a small and cute animal,
   0.051831  The cat is an independent and agile do
   0.051601  The dog is a very popular domestic ani

Those values match what GraphQL returns for the same query (0.05484826, 0.05183117, 0.051601294), so the server is doing the same work either way.

Verified against Weaviate 1.39.0 with reranker-cohere, client 6.3.1. The equivalent GraphQL queries succeed for both BM25 and Hybrid:

{ Get { Reranker(limit: 3, bm25: {query: "animal"}) {
    t1 _additional { rerank(property: "t1", query: "fish") { score } } } } }

Other clients expose it

The docs page for reranking has a "Rerank keyword search results" section with bm25Rerank examples for Python, JavaScript/TypeScript, Go and GraphQL. Java is the only language missing from that tab set.

Suggested fix

Move rerank from BaseVectorSearchBuilder up to BaseQueryOptions.Builder, so every search operator inherits it. Rerank.appendTo(SearchRequest.Builder) already targets the top-level request, so no marshalling change appears to be needed.

Version

  • java-client 6.3.1 (also present in 6.3.0)
  • Weaviate 1.39.0
Lingua principale
Java
Stelle
34
Fork
30
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di weaviate/java-client

Tutte le issue di weaviate/java-client

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.