diff --git a/integrations/opensearch/src/haystack_integrations/components/retrievers/opensearch/bm25_retriever.py b/integrations/opensearch/src/haystack_integrations/components/retrievers/opensearch/bm25_retriever.py index 14f1722e1d..6a7a0f3ede 100644 --- a/integrations/opensearch/src/haystack_integrations/components/retrievers/opensearch/bm25_retriever.py +++ b/integrations/opensearch/src/haystack_integrations/components/retrievers/opensearch/bm25_retriever.py @@ -31,7 +31,7 @@ def __init__( *, document_store: OpenSearchDocumentStore, filters: dict[str, Any] | None = None, - fuzziness: int | str = "AUTO", + fuzziness: int | str = 0, top_k: int = 10, scale_score: bool = False, all_terms_must_match: bool = False, diff --git a/integrations/opensearch/src/haystack_integrations/components/retrievers/opensearch/open_search_hybrid_retriever.py b/integrations/opensearch/src/haystack_integrations/components/retrievers/opensearch/open_search_hybrid_retriever.py index fa6417c225..0c7eacc290 100644 --- a/integrations/opensearch/src/haystack_integrations/components/retrievers/opensearch/open_search_hybrid_retriever.py +++ b/integrations/opensearch/src/haystack_integrations/components/retrievers/opensearch/open_search_hybrid_retriever.py @@ -93,7 +93,7 @@ def __init__( embedder: TextEmbedder, # OpenSearchBM25Retriever filters_bm25: dict[str, Any] | None = None, - fuzziness: int | str = "AUTO", + fuzziness: int | str = 0, top_k_bm25: int = 10, scale_score: bool = False, all_terms_must_match: bool = False, diff --git a/integrations/opensearch/src/haystack_integrations/document_stores/opensearch/document_store.py b/integrations/opensearch/src/haystack_integrations/document_stores/opensearch/document_store.py index f7fbd9ae58..df9be9a2a9 100644 --- a/integrations/opensearch/src/haystack_integrations/document_stores/opensearch/document_store.py +++ b/integrations/opensearch/src/haystack_integrations/document_stores/opensearch/document_store.py @@ -1057,7 +1057,7 @@ def _bm25_retrieval( query: str, *, filters: dict[str, Any] | None = None, - fuzziness: int | str = "AUTO", + fuzziness: int | str = 0, top_k: int = 10, scale_score: bool = False, all_terms_must_match: bool = False, @@ -1115,7 +1115,7 @@ async def _bm25_retrieval_async( query: str, *, filters: dict[str, Any] | None = None, - fuzziness: str = "AUTO", + fuzziness: int | str = 0, top_k: int = 10, scale_score: bool = False, all_terms_must_match: bool = False, diff --git a/integrations/opensearch/tests/test_bm25_retriever.py b/integrations/opensearch/tests/test_bm25_retriever.py index 798493a5bf..c1a77675cf 100644 --- a/integrations/opensearch/tests/test_bm25_retriever.py +++ b/integrations/opensearch/tests/test_bm25_retriever.py @@ -68,7 +68,7 @@ def test_to_dict(_mock_opensearch_client): "type": "haystack_integrations.document_stores.opensearch.document_store.OpenSearchDocumentStore", }, "filters": {}, - "fuzziness": "AUTO", + "fuzziness": 0, "top_k": 10, "scale_score": False, "filter_policy": "replace", @@ -163,7 +163,7 @@ def test_run(): mock_store._bm25_retrieval.assert_called_once_with( query="some query", filters={}, - fuzziness="AUTO", + fuzziness=0, top_k=10, scale_score=False, all_terms_must_match=False, @@ -183,7 +183,7 @@ async def test_run_async(): mock_store._bm25_retrieval_async.assert_called_once_with( query="some query", filters={}, - fuzziness="AUTO", + fuzziness=0, top_k=10, scale_score=False, all_terms_must_match=False, @@ -359,7 +359,7 @@ def test_run_with_runtime_document_store(): runtime_store._bm25_retrieval.assert_called_once_with( query="some query", filters={}, - fuzziness="AUTO", + fuzziness=0, top_k=10, scale_score=False, all_terms_must_match=False, @@ -390,7 +390,7 @@ async def test_run_async_with_runtime_document_store(): runtime_store._bm25_retrieval_async.assert_called_once_with( query="some query", filters={}, - fuzziness="AUTO", + fuzziness=0, top_k=10, scale_score=False, all_terms_must_match=False, diff --git a/integrations/opensearch/tests/test_open_search_hybrid_retriever.py b/integrations/opensearch/tests/test_open_search_hybrid_retriever.py index 6fcf76358b..de5a9310fb 100644 --- a/integrations/opensearch/tests/test_open_search_hybrid_retriever.py +++ b/integrations/opensearch/tests/test_open_search_hybrid_retriever.py @@ -78,7 +78,7 @@ class TestOpenSearchHybridRetriever: }, }, "filters_bm25": None, - "fuzziness": "AUTO", + "fuzziness": 0, "top_k_bm25": 10, "scale_score": False, "all_terms_must_match": False, @@ -227,7 +227,7 @@ def test_run_with_extra_runtime_params(self, mock_embedder): filters={"key": "value"}, top_k=1, all_terms_must_match=False, - fuzziness="AUTO", + fuzziness=0, scale_score=False, custom_query=None, ) @@ -260,7 +260,7 @@ def test_run_in_pipeline(self, mock_embedder): filters={"param_a": "default"}, top_k=10, all_terms_must_match=False, - fuzziness="AUTO", + fuzziness=0, scale_score=False, custom_query=None, )