Skip to content

Commit 6e3bddb

Browse files
g-despotclaude
andcommitted
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) <noreply@anthropic.com>
1 parent 440461d commit 6e3bddb

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

_includes/code/howto/search.boost.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
query="transformer architectures",
8282
limit=5,
8383
# highlight-start
84-
boost=Boost.property(
84+
boost=Boost.numeric_property(
8585
"likes",
8686
modifier=Boost.Modifier.LOG1P,
8787
weight=0.7,
@@ -167,8 +167,10 @@
167167
limit=5,
168168
# highlight-start
169169
boost=Boost.blend(
170-
Boost.time_decay("published", origin="now", scale=timedelta(days=30), weight=2.0),
171-
Boost.property("likes", modifier=Boost.Modifier.LOG1P, weight=1.0),
170+
[
171+
Boost.time_decay("published", origin="now", scale=timedelta(days=30), weight=2.0),
172+
Boost.numeric_property("likes", modifier=Boost.Modifier.LOG1P, weight=1.0),
173+
],
172174
weight=0.4,
173175
depth=200, # rescore the top 200 vector matches
174176
),
@@ -222,8 +224,10 @@
222224
limit=5,
223225
# highlight-start
224226
boost=Boost.blend(
225-
Boost.filter(Filter.by_property("category").equal("research"), weight=1.0),
226-
Boost.filter(Filter.by_property("draft").equal(True), weight=-2.0),
227+
[
228+
Boost.filter(Filter.by_property("category").equal("research"), weight=1.0),
229+
Boost.filter(Filter.by_property("draft").equal(True), weight=-2.0),
230+
],
227231
weight=0.3,
228232
),
229233
# highlight-end

docs/weaviate/search/boost.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import BoostPreview from '/_includes/feature-notes/boost.mdx';
1616

1717
**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.
1818

19-
Apply boost to vector, hybrid, BM25, near-text, near-vector, near-object, and aggregate queries.
19+
Apply boost to vector, hybrid, BM25, near-text, near-vector, near-object, near-image, and near-media queries.
2020

2121
## How it works
2222

0 commit comments

Comments
 (0)