elasticsearch-haystack 0.1.1__tar.gz → 0.1.2__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.1.1 → elasticsearch_haystack-0.1.2}/PKG-INFO +4 -4
- {elasticsearch_haystack-0.1.1 → elasticsearch_haystack-0.1.2}/README.md +1 -1
- {elasticsearch_haystack-0.1.1 → elasticsearch_haystack-0.1.2}/pyproject.toml +9 -4
- {elasticsearch_haystack-0.1.1 → elasticsearch_haystack-0.1.2}/src/elasticsearch_haystack/document_store.py +1 -1
- {elasticsearch_haystack-0.1.1 → elasticsearch_haystack-0.1.2}/tests/test_document_store.py +27 -0
- elasticsearch_haystack-0.1.1/src/elasticsearch_haystack/__about__.py +0 -4
- {elasticsearch_haystack-0.1.1 → elasticsearch_haystack-0.1.2}/.gitignore +0 -0
- {elasticsearch_haystack-0.1.1 → elasticsearch_haystack-0.1.2}/LICENSE +0 -0
- {elasticsearch_haystack-0.1.1 → elasticsearch_haystack-0.1.2}/docker-compose.yml +0 -0
- {elasticsearch_haystack-0.1.1 → elasticsearch_haystack-0.1.2}/src/elasticsearch_haystack/__init__.py +0 -0
- {elasticsearch_haystack-0.1.1 → elasticsearch_haystack-0.1.2}/src/elasticsearch_haystack/bm25_retriever.py +0 -0
- {elasticsearch_haystack-0.1.1 → elasticsearch_haystack-0.1.2}/src/elasticsearch_haystack/embedding_retriever.py +0 -0
- {elasticsearch_haystack-0.1.1 → elasticsearch_haystack-0.1.2}/src/elasticsearch_haystack/filters.py +0 -0
- {elasticsearch_haystack-0.1.1 → elasticsearch_haystack-0.1.2}/tests/__init__.py +0 -0
- {elasticsearch_haystack-0.1.1 → elasticsearch_haystack-0.1.2}/tests/test_bm25_retriever.py +0 -0
- {elasticsearch_haystack-0.1.1 → elasticsearch_haystack-0.1.2}/tests/test_embedding_retriever.py +0 -0
- {elasticsearch_haystack-0.1.1 → elasticsearch_haystack-0.1.2}/tests/test_filters.py +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: elasticsearch-haystack
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.2
|
|
4
4
|
Summary: Haystack 2.x Document Store for ElasticSearch
|
|
5
|
-
Project-URL: Documentation, https://github.com/deepset-ai/haystack-core-integrations/tree/main/
|
|
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
|
|
7
|
-
Project-URL: Source, https://github.com/deepset-ai/haystack-core-integrations/tree/main/
|
|
7
|
+
Project-URL: Source, https://github.com/deepset-ai/haystack-core-integrations/tree/main/integrations/elasticsearch
|
|
8
8
|
Author-email: Silvano Cerza <silvanocerza@gmail.com>
|
|
9
9
|
License-Expression: Apache-2.0
|
|
10
10
|
License-File: LICENSE
|
|
@@ -21,7 +21,7 @@ Requires-Dist: elasticsearch<9,>=8
|
|
|
21
21
|
Requires-Dist: haystack-ai
|
|
22
22
|
Description-Content-Type: text/markdown
|
|
23
23
|
|
|
24
|
-
[](https://github.com/deepset-ai/haystack-core-integrations/actions/workflows/elasticsearch.yml)
|
|
25
25
|
|
|
26
26
|
[](https://pypi.org/project/elasticsearch-haystack)
|
|
27
27
|
[](https://pypi.org/project/elasticsearch-haystack)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[](https://github.com/deepset-ai/haystack-core-integrations/actions/workflows/elasticsearch.yml)
|
|
2
2
|
|
|
3
3
|
[](https://pypi.org/project/elasticsearch-haystack)
|
|
4
4
|
[](https://pypi.org/project/elasticsearch-haystack)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
[build-system]
|
|
2
|
-
requires = ["hatchling"]
|
|
2
|
+
requires = ["hatchling", "hatch-vcs"]
|
|
3
3
|
build-backend = "hatchling.build"
|
|
4
4
|
|
|
5
5
|
[project]
|
|
@@ -29,12 +29,17 @@ dependencies = [
|
|
|
29
29
|
]
|
|
30
30
|
|
|
31
31
|
[project.urls]
|
|
32
|
-
Documentation = "https://github.com/deepset-ai/haystack-core-integrations/tree/main/
|
|
32
|
+
Documentation = "https://github.com/deepset-ai/haystack-core-integrations/tree/main/integrations/elasticsearch#readme"
|
|
33
33
|
Issues = "https://github.com/deepset-ai/haystack-core-integrations/issues"
|
|
34
|
-
Source = "https://github.com/deepset-ai/haystack-core-integrations/tree/main/
|
|
34
|
+
Source = "https://github.com/deepset-ai/haystack-core-integrations/tree/main/integrations/elasticsearch"
|
|
35
35
|
|
|
36
36
|
[tool.hatch.version]
|
|
37
|
-
|
|
37
|
+
source = "vcs"
|
|
38
|
+
tag-pattern = 'integrations\/elasticsearch-v(?P<version>.*)'
|
|
39
|
+
|
|
40
|
+
[tool.hatch.version.raw-options]
|
|
41
|
+
root = "../.."
|
|
42
|
+
git_describe_command = 'git describe --tags --match="integrations/elasticsearch-v[0-9]*"'
|
|
38
43
|
|
|
39
44
|
[tool.hatch.envs.default]
|
|
40
45
|
dependencies = [
|
|
@@ -182,6 +182,33 @@ class TestDocumentStore(DocumentStoreBaseTests):
|
|
|
182
182
|
assert "functional" in res[1].content
|
|
183
183
|
assert "functional" in res[2].content
|
|
184
184
|
|
|
185
|
+
def test_bm25_not_all_terms_must_match(self, document_store: ElasticsearchDocumentStore):
|
|
186
|
+
"""
|
|
187
|
+
Test that not all terms must mandatorily match for BM25 retrieval to return a result.
|
|
188
|
+
"""
|
|
189
|
+
documents = [
|
|
190
|
+
Document(id=1, content="There are over 7,000 languages spoken around the world today."),
|
|
191
|
+
Document(
|
|
192
|
+
id=2,
|
|
193
|
+
content=(
|
|
194
|
+
"Elephants have been observed to behave in a way that indicates a high level of self-awareness"
|
|
195
|
+
" such as recognizing themselves in mirrors."
|
|
196
|
+
),
|
|
197
|
+
),
|
|
198
|
+
Document(
|
|
199
|
+
id=3,
|
|
200
|
+
content=(
|
|
201
|
+
"In certain parts of the world, like the Maldives, Puerto Rico, and San Diego, you can witness"
|
|
202
|
+
" the phenomenon of bioluminescent waves."
|
|
203
|
+
),
|
|
204
|
+
),
|
|
205
|
+
]
|
|
206
|
+
document_store.write_documents(documents)
|
|
207
|
+
|
|
208
|
+
res = document_store._bm25_retrieval("How much self awareness do elephants have?", top_k=3)
|
|
209
|
+
assert len(res) == 1
|
|
210
|
+
assert res[0].id == 2
|
|
211
|
+
|
|
185
212
|
def test_embedding_retrieval(self, document_store: ElasticsearchDocumentStore):
|
|
186
213
|
docs = [
|
|
187
214
|
Document(content="Most similar document", embedding=[1.0, 1.0, 1.0, 1.0]),
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{elasticsearch_haystack-0.1.1 → elasticsearch_haystack-0.1.2}/src/elasticsearch_haystack/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{elasticsearch_haystack-0.1.1 → elasticsearch_haystack-0.1.2}/src/elasticsearch_haystack/filters.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{elasticsearch_haystack-0.1.1 → elasticsearch_haystack-0.1.2}/tests/test_embedding_retriever.py
RENAMED
|
File without changes
|
|
File without changes
|