From 6e3bddb2fb9bae97fa463bc572189575f82dc13d Mon Sep 17 00:00:00 2001 From: Ivan Despot <66276597+g-despot@users.noreply.github.com> Date: Tue, 16 Jun 2026 11:21:44 +0200 Subject: [PATCH] docs: fix Boost API examples and supported-query list - Correct the Python examples on the Boost search page: - Boost.property(...) -> Boost.numeric_property(...) (the .property factory does not exist on the client) - Boost.blend(...) with multiple conditions now passes them as a list, matching the signature Boost.blend(boosts, *, weight, depth); the old multi-positional form raised TypeError - List near-image and near-media among the boost-supported queries. - Remove the mention of boost on aggregation: the server accepts it over gRPC but no client exposes it yet, so it does not belong in the client-facing docs. The corrected snippet was verified end-to-end against Weaviate 1.38. Co-Authored-By: Claude Opus 4.8 (1M context) --- _includes/code/howto/search.boost.py | 14 +++++++++----- docs/weaviate/search/boost.md | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/_includes/code/howto/search.boost.py b/_includes/code/howto/search.boost.py index cb91f51d..4caa5f3f 100644 --- a/_includes/code/howto/search.boost.py +++ b/_includes/code/howto/search.boost.py @@ -81,7 +81,7 @@ query="transformer architectures", limit=5, # highlight-start - boost=Boost.property( + boost=Boost.numeric_property( "likes", modifier=Boost.Modifier.LOG1P, weight=0.7, @@ -167,8 +167,10 @@ limit=5, # highlight-start boost=Boost.blend( - Boost.time_decay("published", origin="now", scale=timedelta(days=30), weight=2.0), - Boost.property("likes", modifier=Boost.Modifier.LOG1P, weight=1.0), + [ + Boost.time_decay("published", origin="now", scale=timedelta(days=30), weight=2.0), + Boost.numeric_property("likes", modifier=Boost.Modifier.LOG1P, weight=1.0), + ], weight=0.4, depth=200, # rescore the top 200 vector matches ), @@ -222,8 +224,10 @@ limit=5, # highlight-start boost=Boost.blend( - Boost.filter(Filter.by_property("category").equal("research"), weight=1.0), - Boost.filter(Filter.by_property("draft").equal(True), weight=-2.0), + [ + Boost.filter(Filter.by_property("category").equal("research"), weight=1.0), + Boost.filter(Filter.by_property("draft").equal(True), weight=-2.0), + ], weight=0.3, ), # highlight-end diff --git a/docs/weaviate/search/boost.md b/docs/weaviate/search/boost.md index 7bc9ecd7..7fe9c60c 100644 --- a/docs/weaviate/search/boost.md +++ b/docs/weaviate/search/boost.md @@ -16,7 +16,7 @@ import BoostPreview from '/_includes/feature-notes/boost.mdx'; **Boost** soft-ranks search results — promote or demote matching documents without removing them from the result set. Matching documents move up. Non-matching documents stay in the results but rank lower. -Apply boost to vector, hybrid, BM25, near-text, near-vector, near-object, and aggregate queries. +Apply boost to vector, hybrid, BM25, near-text, near-vector, near-object, near-image, and near-media queries. ## How it works