Skip to content

Commit 02dd1d7

Browse files
authored
Merge pull request #451 from weaviate/docs/fix-boost-page
docs: fix Boost API examples and supported-query list
2 parents 535eed5 + 6e3bddb commit 02dd1d7

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)