Skip to content

Commit

Permalink
Update elasticsearch-document-store.md (#136)
Browse files Browse the repository at this point in the history
  • Loading branch information
masci authored Jan 19, 2024
1 parent 3509df7 commit 100c8c9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions integrations/elasticsearch-document-store.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ pip install elasticsearch-haystack
Once installed, you can start using your Elasticsearch database with Haystack by initializing it:

```python
from elasticsearch_haystack.document_store import ElasticsearchDocumentStore
from haystack_integrations.document_stores.elasticsearch import ElasticsearchDocumentStore

document_store = ElasticsearchDocumentStore(hosts = "http://localhost:9200")
```
Expand All @@ -58,7 +58,7 @@ For this step, you can use the available [TextFileToDocument](https://docs.hayst
#### Indexing Pipeline

```python
from elasticsearch_haystack.document_store import ElasticsearchDocumentStore
from haystack_integrations.document_stores.elasticsearch import ElasticsearchDocumentStore
from haystack.pipeline import Pipeline
from haystack.components.embedders import SentenceTransformersDocumentEmbedder
from haystack.components.converters import TextFileToDocument
Expand Down Expand Up @@ -91,10 +91,10 @@ indexing_pipeline.run({
Once you have documents in your `ElasticsearchDocumentStore`, it's ready to be used with with [ElasticsearchEmbeddingRetriever](https://github.com/deepset-ai/haystack-core-integrations/blob/main/integrations/elasticsearch/src/elasticsearch_haystack/embedding_retriever.py) in the retrieval step of any Haystack pipeline such as a Retrieval Augmented Generation (RAG) pipelines. Learn more about [Retrievers](https://docs.haystack.deepset.ai/v2.0/docs/retrievers) to make use of vector search within your LLM pipelines.

```python
from elasticsearch_haystack.document_store import ElasticsearchDocumentStore
from haystack_integrations.document_stores.elasticsearch import ElasticsearchDocumentStore
from haystack.pipeline import Pipeline
from haystack.components.embedders import SentenceTransformersTextEmbedder
from elasticsearch_haystack.embedding_retriever import ElasticsearchEmbeddingRetriever
from haystack_integrations.components.retrievers.elasticsearch import ElasticsearchEmbeddingRetriever

model = "sentence-transformers/multi-qa-mpnet-base-dot-v1"

Expand Down

0 comments on commit 100c8c9

Please sign in to comment.