feat: add distance_type() parameter to python sync query builders and metric() as an alias (#2073)

This PR aims to fix #2047 by doing the following things:
- Add a distance_type parameter to the sync query builders of Python
SDK.
- Make metric an alias to distance_type.
This commit is contained in:
Vaibhav
2025-01-28 13:59:53 -08:00
committed by GitHub
parent 0a9e1eab75
commit dac0857745
6 changed files with 74 additions and 16 deletions

View File

@@ -1242,7 +1242,9 @@ def test_hybrid_search_metric_type(tmp_db: DBConnection):
# with custom metric
result_dot = (
table.search("feeling lucky", query_type="hybrid").metric("dot").to_arrow()
table.search("feeling lucky", query_type="hybrid")
.distance_type("dot")
.to_arrow()
)
result_l2 = table.search("feeling lucky", query_type="hybrid").to_arrow()
assert len(result_dot) > 0