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