docs: add example for reusing an existing collection (#32774)

Added a short section to the Weaviate integration docs showing how to
connect to an existing collection (reuse an index) with
`WeaviateVectorStore`. This helps clarify required parameters
(`index_name`, `text_key`) when loading a pre-existing store, which was
previously missing.

Thank you for contributing to LangChain! Follow these steps to mark your
pull request as ready for review. **If any of these steps are not
completed, your PR will not be considered for review.**

### Description
Added a short section to the Weaviate integration docs showing how to
connect to an existing collection (reuse an index) with
`WeaviateVectorStore`. This helps clarify required parameters
(`index_name`, `text_key`) when loading a pre-existing store, which was
previously missing.

### Issue
Fixes langchain-ai/langchain-weaviate#197

### Dependencies
None
This commit is contained in:
may
2025-09-11 11:16:46 +09:00
committed by GitHub
parent 221c96e7b4
commit 2c2bab93fc

View File

@@ -47,7 +47,20 @@
"\n",
"Some Weaviate instances, such as those running on WCS, have authentication enabled, such as API key and/or username+password authentication.\n",
"\n",
"Read the [client authentication guide](https://weaviate.io/developers/weaviate/client-libraries/python#authentication) for more information, as well as the [in-depth authentication configuration page](https://weaviate.io/developers/weaviate/configuration/authentication)."
"Read the [client authentication guide](https://weaviate.io/developers/weaviate/client-libraries/python#authentication) for more information, as well as the [in-depth authentication configuration page](https://weaviate.io/developers/weaviate/configuration/authentication).\n",
"\n",
"### Connect to an existing collection (reuse an index)\n",
"If you already created a collection in your local Weaviate instance, you can connect to it directly:",
"\n",
"```python\n",
"from langchain_weaviate import WeaviateVectorStore\n",
"\n",
"store = WeaviateVectorStore(\n",
" client=weaviate_client,\n",
" index_name=\"Test\",\n",
" text_key=\"text\",\n",
")\n",
"```\n"
]
},
{