Skip to content

feat(query): add Boost parameter to all query types#592

Merged
bevzzz merged 10 commits into
mainfrom
feat/boost
Jun 26, 2026
Merged

feat(query): add Boost parameter to all query types#592
bevzzz merged 10 commits into
mainfrom
feat/boost

Conversation

@bevzzz

@bevzzz bevzzz commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

This PR adds a Boost parameter to all query types. The API mirrors the reference implementation in the Python client.

var boost = Boost.filter(Filter.and(...), b -> b.weight(.1f));
var boost = Boost.timeDecay("last_seen", "14d", b -> b.origin("2024-01-01T00:00:00Z"));
var boost = Boost.numericDecay("size", 36f, .55f, b -> b.curve(Boost.Curve.LINEAR));
var boost = Boost.numericProperty("size", b -> b.modifier(Boost.Modifier.LOG1P).depth(2f));

c.query.nearVector(v, opt -> opt.boost(boost));

N.B.: a big chunk of the diff is the re-generated WeaviateProtoSearchGet (~6.2K), which can be safely ignored.

Closes #576

@bevzzz bevzzz requested a review from a team as a code owner June 25, 2026 10:59

@orca-security-eu orca-security-eu Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Orca Security Scan Summary

Status Check Issues by priority
Passed Passed Infrastructure as Code high 0   medium 0   low 0   info 0 View in Orca
Passed Passed SAST high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Secrets high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Vulnerabilities high 0   medium 0   low 0   info 0 View in Orca

bevzzz added 3 commits June 25, 2026 13:48
…client does not know how to read"

This reverts commit eafa90a.
Namespaces permissions are not supported by the client yet.
The tests will fail because admin role has those permissions.
The client is supposed to fail when it encounters unknown permissions.
@trengrj

trengrj commented Jun 26, 2026

Copy link
Copy Markdown
Member

LGTM, just one comment the python client checks that depth is not set on sub boosts. Would be good to also validate this in the java client (couldn't find if this exists).

        if len(boosts) == 0:
            raise WeaviateInvalidInputError("Boost.blend() requires at least one boost.")
        for r in boosts:
            if r.depth is not None:
                raise WeaviateInvalidInputError(
                    "Cannot set `depth` on sub-boosts passed to `blend()`. Use the top-level `depth` parameter instead."
                )

@bevzzz

bevzzz commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator Author

@trengrj added that validation 👍

As a general rule, I try to let the server validate the request and not duplicate that logic on the client as well; this is a good example of a situation in which the server wouldn't even known depth was set on a null sub-boost, so this can only be validated client-side.

@bevzzz bevzzz merged commit 171287c into main Jun 26, 2026
5 checks passed
@bevzzz bevzzz deleted the feat/boost branch June 26, 2026 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Boost API

2 participants