feat: add Boost query API (Weaviate 1.38 Preview)#355
Open
g-despot wants to merge 6 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.7%
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
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".