mirror of
https://github.com/deepset-ai/haystack.git
synced 2025-07-22 16:31:16 +00:00

* Add memory sharing between different instances of InMemoryDocumentStore * Fix FilterRetriever tests * Fix InMemoryBM25Retriever tests
20 lines
655 B
YAML
20 lines
655 B
YAML
---
|
|
features:
|
|
- |
|
|
Add memory sharing between different instances of InMemoryDocumentStore.
|
|
Setting the same `index` argument as another instance will make sure that the memory is shared.
|
|
e.g.
|
|
```python
|
|
index = "my_personal_index"
|
|
document_store_1 = InMemoryDocumentStore(index=index)
|
|
document_store_2 = InMemoryDocumentStore(index=index)
|
|
|
|
assert document_store_1.count_documents() == 0
|
|
assert document_store_2.count_documents() == 0
|
|
|
|
document_store_1.write_documents([Document(content="Hello world")])
|
|
|
|
assert document_store_1.count_documents() == 1
|
|
assert document_store_2.count_documents() == 1
|
|
```
|