Skip to content

Commit

Permalink
make weight defined in run to be used even if 0 (#7343)
Browse files Browse the repository at this point in the history
  • Loading branch information
anakin87 committed Mar 11, 2024
1 parent ad2366c commit f8b9f71
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion haystack/components/rankers/meta_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def run(
return {"documents": []}

top_k = top_k or self.top_k
weight = weight or self.weight
weight = weight if weight is not None else self.weight
ranking_mode = ranking_mode or self.ranking_mode
sort_order = sort_order or self.sort_order
meta_value_type = meta_value_type or self.meta_value_type
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
fixes:
- |
Fixed a bug in the `MetaFieldRanker`: when the `weight` parameter was set to 0 in the `run` method,
the component was incorrectly using the default `weight` parameter set in the `__init__` method.

0 comments on commit f8b9f71

Please sign in to comment.