Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[community] docs: another auth method for ElasticsearchStore #16831

Merged
merged 1 commit into from
Feb 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion docs/docs/integrations/vectorstores/elasticsearch.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,28 @@
" )\n",
"```\n",
"\n",
"You can also use an `Elasticsearch` client object that gives you more flexibility, for example to configure the maximum number of retries.\n",
"\n",
"Example:\n",
"```python\n",
" import elasticsearch\n",
" from langchain_community.vectorstores import ElasticsearchStore\n",
"\n",
" es_client= elasticsearch.Elasticsearch(\n",
" hosts=[\"http://localhost:9200\"],\n",
" es_user=\"elastic\",\n",
" es_password=\"changeme\"\n",
" max_retries=10,\n",
" )\n",
"\n",
" embedding = OpenAIEmbeddings()\n",
" elastic_vector_search = ElasticsearchStore(\n",
" index_name=\"test_index\",\n",
" es_connection=es_client,\n",
" embedding=embedding,\n",
" )\n",
"```\n",
"\n",
"#### How to obtain a password for the default \"elastic\" user?\n",
"\n",
"To obtain your Elastic Cloud password for the default \"elastic\" user:\n",
Expand Down Expand Up @@ -134,7 +156,7 @@
"id": "ea167a29",
"metadata": {},
"source": [
"We want to use `OpenAIEmbeddings` so we have to get the OpenAI API Key."
"To use the `OpenAIEmbeddings` we have to configure the OpenAI API Key in the environment."
]
},
{
Expand Down
Loading