elasticsearch-haystack 0.7.0__tar.gz → 0.7.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of elasticsearch-haystack might be problematic. Click here for more details.
- {elasticsearch_haystack-0.7.0 → elasticsearch_haystack-0.7.1}/PKG-INFO +1 -1
- {elasticsearch_haystack-0.7.0 → elasticsearch_haystack-0.7.1}/src/haystack_integrations/components/retrievers/elasticsearch/bm25_retriever.py +4 -1
- {elasticsearch_haystack-0.7.0 → elasticsearch_haystack-0.7.1}/src/haystack_integrations/components/retrievers/elasticsearch/embedding_retriever.py +4 -1
- {elasticsearch_haystack-0.7.0 → elasticsearch_haystack-0.7.1}/tests/test_bm25_retriever.py +24 -0
- {elasticsearch_haystack-0.7.0 → elasticsearch_haystack-0.7.1}/tests/test_embedding_retriever.py +23 -0
- {elasticsearch_haystack-0.7.0 → elasticsearch_haystack-0.7.1}/.gitignore +0 -0
- {elasticsearch_haystack-0.7.0 → elasticsearch_haystack-0.7.1}/CHANGELOG.md +0 -0
- {elasticsearch_haystack-0.7.0 → elasticsearch_haystack-0.7.1}/LICENSE +0 -0
- {elasticsearch_haystack-0.7.0 → elasticsearch_haystack-0.7.1}/README.md +0 -0
- {elasticsearch_haystack-0.7.0 → elasticsearch_haystack-0.7.1}/docker-compose.yml +0 -0
- {elasticsearch_haystack-0.7.0 → elasticsearch_haystack-0.7.1}/pydoc/config.yml +0 -0
- {elasticsearch_haystack-0.7.0 → elasticsearch_haystack-0.7.1}/pyproject.toml +0 -0
- {elasticsearch_haystack-0.7.0 → elasticsearch_haystack-0.7.1}/src/haystack_integrations/components/retrievers/elasticsearch/__init__.py +0 -0
- {elasticsearch_haystack-0.7.0 → elasticsearch_haystack-0.7.1}/src/haystack_integrations/document_stores/elasticsearch/__init__.py +0 -0
- {elasticsearch_haystack-0.7.0 → elasticsearch_haystack-0.7.1}/src/haystack_integrations/document_stores/elasticsearch/document_store.py +0 -0
- {elasticsearch_haystack-0.7.0 → elasticsearch_haystack-0.7.1}/src/haystack_integrations/document_stores/elasticsearch/filters.py +0 -0
- {elasticsearch_haystack-0.7.0 → elasticsearch_haystack-0.7.1}/tests/__init__.py +0 -0
- {elasticsearch_haystack-0.7.0 → elasticsearch_haystack-0.7.1}/tests/test_document_store.py +0 -0
- {elasticsearch_haystack-0.7.0 → elasticsearch_haystack-0.7.1}/tests/test_filters.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: elasticsearch-haystack
|
|
3
|
-
Version: 0.7.
|
|
3
|
+
Version: 0.7.1
|
|
4
4
|
Summary: Haystack 2.x Document Store for ElasticSearch
|
|
5
5
|
Project-URL: Documentation, https://github.com/deepset-ai/haystack-core-integrations/tree/main/integrations/elasticsearch#readme
|
|
6
6
|
Project-URL: Issues, https://github.com/deepset-ai/haystack-core-integrations/issues
|
|
@@ -108,7 +108,10 @@ class ElasticsearchBM25Retriever:
|
|
|
108
108
|
data["init_parameters"]["document_store"] = ElasticsearchDocumentStore.from_dict(
|
|
109
109
|
data["init_parameters"]["document_store"]
|
|
110
110
|
)
|
|
111
|
-
|
|
111
|
+
# Pipelines serialized with old versions of the component might not
|
|
112
|
+
# have the filter_policy field.
|
|
113
|
+
if filter_policy := data["init_parameters"].get("filter_policy"):
|
|
114
|
+
data["init_parameters"]["filter_policy"] = FilterPolicy.from_str(filter_policy)
|
|
112
115
|
return default_from_dict(cls, data)
|
|
113
116
|
|
|
114
117
|
@component.output_types(documents=List[Document])
|
|
@@ -106,7 +106,10 @@ class ElasticsearchEmbeddingRetriever:
|
|
|
106
106
|
data["init_parameters"]["document_store"] = ElasticsearchDocumentStore.from_dict(
|
|
107
107
|
data["init_parameters"]["document_store"]
|
|
108
108
|
)
|
|
109
|
-
|
|
109
|
+
# Pipelines serialized with old versions of the component might not
|
|
110
|
+
# have the filter_policy field.
|
|
111
|
+
if filter_policy := data["init_parameters"].get("filter_policy"):
|
|
112
|
+
data["init_parameters"]["filter_policy"] = FilterPolicy.from_str(filter_policy)
|
|
110
113
|
return default_from_dict(cls, data)
|
|
111
114
|
|
|
112
115
|
@component.output_types(documents=List[Document])
|
|
@@ -77,6 +77,30 @@ def test_from_dict(_mock_elasticsearch_client):
|
|
|
77
77
|
assert retriever._filter_policy == FilterPolicy.REPLACE
|
|
78
78
|
|
|
79
79
|
|
|
80
|
+
@patch("haystack_integrations.document_stores.elasticsearch.document_store.Elasticsearch")
|
|
81
|
+
def test_from_dict_no_filter_policy(_mock_elasticsearch_client):
|
|
82
|
+
data = {
|
|
83
|
+
"type": "haystack_integrations.components.retrievers.elasticsearch.bm25_retriever.ElasticsearchBM25Retriever",
|
|
84
|
+
"init_parameters": {
|
|
85
|
+
"document_store": {
|
|
86
|
+
"init_parameters": {"hosts": "some fake host", "index": "default"},
|
|
87
|
+
"type": "haystack_integrations.document_stores.elasticsearch.document_store.ElasticsearchDocumentStore",
|
|
88
|
+
},
|
|
89
|
+
"filters": {},
|
|
90
|
+
"fuzziness": "AUTO",
|
|
91
|
+
"top_k": 10,
|
|
92
|
+
"scale_score": True,
|
|
93
|
+
},
|
|
94
|
+
}
|
|
95
|
+
retriever = ElasticsearchBM25Retriever.from_dict(data)
|
|
96
|
+
assert retriever._document_store
|
|
97
|
+
assert retriever._filters == {}
|
|
98
|
+
assert retriever._fuzziness == "AUTO"
|
|
99
|
+
assert retriever._top_k == 10
|
|
100
|
+
assert retriever._scale_score
|
|
101
|
+
assert retriever._filter_policy == FilterPolicy.REPLACE # defaults to REPLACE
|
|
102
|
+
|
|
103
|
+
|
|
80
104
|
def test_run():
|
|
81
105
|
mock_store = Mock(spec=ElasticsearchDocumentStore)
|
|
82
106
|
mock_store._bm25_retrieval.return_value = [Document(content="Test doc")]
|
{elasticsearch_haystack-0.7.0 → elasticsearch_haystack-0.7.1}/tests/test_embedding_retriever.py
RENAMED
|
@@ -74,6 +74,29 @@ def test_from_dict(_mock_elasticsearch_client):
|
|
|
74
74
|
assert retriever._num_candidates is None
|
|
75
75
|
|
|
76
76
|
|
|
77
|
+
@patch("haystack_integrations.document_stores.elasticsearch.document_store.Elasticsearch")
|
|
78
|
+
def test_from_dict_no_filter_policy(_mock_elasticsearch_client):
|
|
79
|
+
t = "haystack_integrations.components.retrievers.elasticsearch.embedding_retriever.ElasticsearchEmbeddingRetriever"
|
|
80
|
+
data = {
|
|
81
|
+
"type": t,
|
|
82
|
+
"init_parameters": {
|
|
83
|
+
"document_store": {
|
|
84
|
+
"init_parameters": {"hosts": "some fake host", "index": "default"},
|
|
85
|
+
"type": "haystack_integrations.document_stores.elasticsearch.document_store.ElasticsearchDocumentStore",
|
|
86
|
+
},
|
|
87
|
+
"filters": {},
|
|
88
|
+
"top_k": 10,
|
|
89
|
+
"num_candidates": None,
|
|
90
|
+
},
|
|
91
|
+
}
|
|
92
|
+
retriever = ElasticsearchEmbeddingRetriever.from_dict(data)
|
|
93
|
+
assert retriever._document_store
|
|
94
|
+
assert retriever._filters == {}
|
|
95
|
+
assert retriever._top_k == 10
|
|
96
|
+
assert retriever._num_candidates is None
|
|
97
|
+
assert retriever._filter_policy == FilterPolicy.REPLACE # defaults to REPLACE
|
|
98
|
+
|
|
99
|
+
|
|
77
100
|
def test_run():
|
|
78
101
|
mock_store = Mock(spec=ElasticsearchDocumentStore)
|
|
79
102
|
mock_store._embedding_retrieval.return_value = [Document(content="Test doc", embedding=[0.1, 0.2])]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|