feat: add Boost query API (Weaviate 1.38 Preview) - #355
Open
g-despot wants to merge 7 commits into
Open
Conversation
…ate methods Weaviate 1.38 Preview, gRPC-only. Adds the Boost model (filter, time_decay, numeric_decay, numeric_property conditions plus weighted blend), the Boost proto message + optional SearchRequest.boost field 62 (from the v1.38.4 server proto), request serialization in BuildBoost, and an optional boost parameter on every BM25/Hybrid/NearText/NearVector/NearObject/NearMedia overload of QueryClient, GenerateClient and the typed clients (FetchObjects excluded, matching python client PR #2030). All server defaults (weight 0.5, depth 100, curve exponential, decay 0.5) are left to the server via proto field presence; the only client-side default is time_decay origin=now.
Pre-1.38 servers silently ignore the boost proto field, so on CI's matrix
(<= 1.37.5) the asserted orderings would fail rather than skip. Each of the
five tests now calls RequireVersion("1.38.0") per repo convention.
There was a problem hiding this comment.
Orca Security Scan Summary
| Status | Check | Issues by priority | |
|---|---|---|---|
| Infrastructure as Code | View in Orca | ||
| SAST | View in Orca | ||
| Secrets | View in Orca | ||
| Vulnerabilities | View in Orca |
Summary - Weaviate C# Client CoverageSummary
CoverageWeaviate.Client - 49.5%
Weaviate.Client.Analyzers - 0%
Weaviate.Client.VectorData - 50.3%
|
Contributor
There was a problem hiding this comment.
Pull request overview
Adds the Weaviate 1.38 (Preview, gRPC-only) Boost soft-ranking API to the C# client by introducing a new Boost model, extending the gRPC proto/request builder to serialize it, and threading an optional boost parameter through the query/generate (including typed) surfaces, with unit + integration coverage.
Changes:
- Introduces
Models/Boost.cswith factory methods for filter/time-decay/numeric boosts and blending. - Extends gRPC
SearchRequestproto and request building to include the optionalboostfield and map model → proto. - Adds
boostparameters across relevant Query/Generate APIs (including typed clients) plus unit/integration tests verifying serialization and ranking behavior.
Reviewed changes
Copilot reviewed 30 out of 31 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/Weaviate.Client/Typed/TypedQueryClient.NearVector.cs | Threads optional boost through typed NearVector query overloads and XML docs. |
| src/Weaviate.Client/Typed/TypedQueryClient.NearText.cs | Threads optional boost through typed NearText query overloads and XML docs. |
| src/Weaviate.Client/Typed/TypedQueryClient.NearObject.cs | Threads optional boost through typed NearObject query overloads and XML docs. |
| src/Weaviate.Client/Typed/TypedQueryClient.NearMedia.cs | Threads optional boost through typed NearMedia query overloads and XML docs. |
| src/Weaviate.Client/Typed/TypedQueryClient.Hybrid.cs | Adds optional boost to typed Hybrid query overloads. |
| src/Weaviate.Client/Typed/TypedQueryClient.BM25.cs | Adds optional boost to typed BM25 query overloads and XML docs. |
| src/Weaviate.Client/Typed/TypedGenerateClient.NearVector.cs | Threads optional boost through typed NearVector generate overloads and XML docs. |
| src/Weaviate.Client/Typed/TypedGenerateClient.NearText.cs | Threads optional boost through typed NearText generate overloads and XML docs. |
| src/Weaviate.Client/Typed/TypedGenerateClient.NearObject.cs | Threads optional boost through typed NearObject generate overloads and XML docs. |
| src/Weaviate.Client/Typed/TypedGenerateClient.NearMedia.cs | Threads optional boost through typed NearMedia generate overloads and XML docs. |
| src/Weaviate.Client/Typed/TypedGenerateClient.Hybrid.cs | Adds optional boost to typed Hybrid generate overloads. |
| src/Weaviate.Client/Typed/TypedGenerateClient.BM25.cs | Adds optional boost to typed BM25 generate overloads and XML docs. |
| src/Weaviate.Client/QueryClient.NearVector.cs | Adds optional boost to NearVector query overloads and passes through to gRPC. |
| src/Weaviate.Client/QueryClient.NearText.cs | Adds optional boost to NearText query overloads and passes through to gRPC. |
| src/Weaviate.Client/QueryClient.NearObject.cs | Adds optional boost to NearObject query overloads and passes through to gRPC. |
| src/Weaviate.Client/QueryClient.NearMedia.cs | Adds optional boost to NearMedia query overloads and passes through to gRPC. |
| src/Weaviate.Client/QueryClient.Hybrid.cs | Adds optional boost to Hybrid query overloads and passes through to gRPC. |
| src/Weaviate.Client/QueryClient.BM25.cs | Adds optional boost to BM25 query overloads and passes through to gRPC. |
| src/Weaviate.Client/GenerateClient.NearVector.cs | Adds optional boost to NearVector generate overloads and passes through to gRPC. |
| src/Weaviate.Client/GenerateClient.NearText.cs | Adds optional boost to NearText generate overloads and passes through to gRPC. |
| src/Weaviate.Client/GenerateClient.NearObject.cs | Adds optional boost to NearObject generate overloads and passes through to gRPC. |
| src/Weaviate.Client/GenerateClient.NearMedia.cs | Adds optional boost to NearMedia generate overloads and passes through to gRPC. |
| src/Weaviate.Client/GenerateClient.Hybrid.cs | Adds optional boost to Hybrid generate overloads and passes through to gRPC. |
| src/Weaviate.Client/GenerateClient.BM25.cs | Adds optional boost to BM25 generate overloads and passes through to gRPC. |
| src/Weaviate.Client/Models/Boost.cs | New public Boost model + factories and blend composition used by gRPC serialization. |
| src/Weaviate.Client/gRPC/Search.cs | Adds boost parameter plumbing through gRPC search entrypoints. |
| src/Weaviate.Client/gRPC/Search.Builders.cs | Adds BuildBoost + curve/modifier mapping and sets SearchRequest.Boost. |
| src/Weaviate.Client/gRPC/proto/v1/search_get.proto | Adds Boost message + optional Boost boost = 62 on SearchRequest. |
| src/Weaviate.Client.Tests/Unit/TestBoostSyntax.cs | Unit tests verifying boost proto serialization + field presence behavior. |
| src/Weaviate.Client.Tests/Integration/TestBoost.cs | Integration tests asserting ranking changes with boost (gated to 1.38+). |
# Conflicts: # src/Weaviate.Client/PublicAPI.Unshipped.txt
g-despot
added a commit
to Shaurya2k06/csharp-client
that referenced
this pull request
Aug 14, 2026
PR weaviate#358 was written against weaviate#355 (feat/boost-query-api), so its <param> tags describe that branch's API rather than main's: - `boost` does not exist on main, so 30 `<param name="boost">` tags document a parameter that is not there (CS1572). They belong with weaviate#355, which is the PR that introduces the parameter. - `diversitySelection` was added to the same 30 methods by weaviate#366 after this PR was written, and was left undocumented (CS1573). Drop the boost tags and document diversitySelection instead, placing each tag at the position its parameter occupies in the signature (after `bm25Operator` in the Hybrid overloads, `distance` in GenerateClient.NearVector, `offset` in the QueryClient.NearText extensions). Also align two style details the PR introduced: `<param name="client">` reads "The client" (26 instances repo-wide, none of "The query client"), and the two QueryClient.NearText extension blocks take the trailing period their prose-style neighbours all use. The worklist was derived from the compiler, not by hand: `dotnet build --no-incremental` now reports 0 CS1572 and 0 CS1573, and the normalized warning set is byte-identical to origin/main (55 unique warnings on both).
Brings in #359 (module endpoint/location), #365 (BM25Operator.AndCross + searchOperator on generate.bm25), #366 (diversitySelection across hybrid and the near* family), and #367 (multimodal vectorizer weights). All of the .cs overload files auto-merged: boost is inserted after `rerank` and diversitySelection after `bm25Operator`/before `autoLimit`, so the two parameter additions never collided. Verified structurally in both directions (merged-minus-boost == origin/main, merged-minus-diversitySelection/ searchOperator == the branch) rather than trusting the auto-merge. The only textual conflict was PublicAPI.Unshipped.txt, where both sides emit a *REMOVED* line plus a replacement signature for the same 102 overloads. Resolved to a deduplicated union (102 identical *REMOVED* lines collapsed), then adjudicated by the public API analyzer: 204 single-parameter signatures were stale (RS0017) and 102 combined signatures were missing (RS0016). After applying those, the RS0016/RS0017 sets are identical to both parents'. Parameter counts after the merge match each parent exactly: boost 111 declarations (as on the branch), diversitySelection 105 and searchOperator 10 (as on main).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Boostmodel withFilter,TimeDecay,NumericDecay,NumericProperty, andBlendfactories plusCurve/Modifierenums; optionalboostparameter on every BM25/Hybrid/Near* query and generate overload, including the typed clients (FetchObjectsexcluded, matching Python).Boostmessage +optional Boost boost = 62onSearchRequest, taken from the server v1.38.4 tag.time_decayorigin = "now".