Skip to content

Commit 07d6bae

Browse files
committed
implement score threshold for formular
1 parent 4ae5a9f commit 07d6bae

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

qdrant_client/local/local_collection.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -851,6 +851,8 @@ def _merge_sources(
851851
with_vectors=with_vectors,
852852
)
853853

854+
rescored = [point for point in rescored if score_threshold is None or point.score >= score_threshold]
855+
854856
return rescored[offset:]
855857
else:
856858
# Re-score with vector

tests/congruence_tests/test_query.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ def dense_query_formula_score_threshold(self, client: QdrantBase) -> list[models
440440
query=models.FormulaQuery(formula=models.MultExpression(mult=["$score", 1.0])),
441441
with_payload=True,
442442
limit=10,
443-
score_threshold=1.0, # todo: score threshold is not applied in formula queries in core
443+
score_threshold=1.0,
444444
).points
445445

446446
def deep_dense_queries_rrf(self, client: QdrantBase) -> models.QueryResponse:

0 commit comments

Comments
 (0)