Add Elasticsearch Docstore (#83)

* add Elasticsearch Docstore

* update missing requirements

* add docstore

* [ignore cache] update default param

* update docstring
This commit is contained in:
Tuan Anh Nguyen Dang (Tadashi_Cin)
2023-11-21 11:59:20 +07:00
committed by GitHub
parent 8bb7ad91e0
commit 9a96a9b876
7 changed files with 402 additions and 14 deletions

View File

@@ -17,14 +17,13 @@ class BaseDocumentStore(ABC):
self,
docs: Union[Document, List[Document]],
ids: Optional[Union[List[str], str]] = None,
exist_ok: bool = False,
**kwargs,
):
"""Add document into document store
Args:
docs: Document or list of documents
ids: List of ids of the documents. Optional, if not set will use doc.doc_id
exist_ok: If True, will not raise error if document already exist
"""
...
@@ -34,10 +33,15 @@ class BaseDocumentStore(ABC):
...
@abstractmethod
def get_all(self) -> dict:
def get_all(self) -> List[Document]:
"""Get all documents"""
...
@abstractmethod
def count(self) -> int:
"""Count number of documents"""
...
@abstractmethod
def delete(self, ids: Union[List[str], str]):
"""Delete document by id"""