# How to load existing db to similarity search?

**URL:** https://forum.weaviate.io/t/how-to-load-existing-db-to-similarity-search/3309
**Category:** Support
**Tags:** bug
**Created:** [August 8, 2024, 5:14pm UTC](https://forum.weaviate.io/t/how-to-load-existing-db-to-similarity-search/3309 "2024-08-08T17:14:21Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![DudaNogueira](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/dudanogueira/32/7846_2.png) [@DudaNogueira](https://forum.weaviate.io/u/DudaNogueira)
#### Post date: [August 13, 2024, 12:40pm UTC](https://forum.weaviate.io/t/how-to-load-existing-db-to-similarity-search/3309/3 "2024-08-13T12:40:58Z")

</div>

Hi @MartinMin !!

O believe you are facing the same issue from this thread:

> [@Langchain WeaviateHybridSearchRetriever with filters?](https://forum.weaviate.io/t/langchain-weaviatehybridsearchretriever-with-filters/3296/6):
>
> Nevermind fixed it. Hey, thank you for the quick replies. I have tried your example but sadly it does not work. When initialising the db, I get an “list index out of range error”. Here is my code: from langchain\_cohere import CohereEmbeddings import weaviate from weaviate.classes.init import Auth from weaviate.classes.query import Filter embeddings = CohereEmbeddings(model=EMBEDDINGS\_MODEL, cohere\_api\_key=COHERE\_API\_KEY) headers = { "X-Cohere-Api-Key": COHERE\_API\_KEY, } client = weavia…

This error seems to come from hugging face interface at langchain:

```auto
langchain_community/embeddings/huggingface.py", line 331,

```

can you try this?

```auto
db = WeaviateVectorStore.from_documents(embeddings=embedding_model, client=weaviate_client, index_name='test')

```

My guess is that the huggingface interface in langchain is not checking when the documents passed as parameter is an empty list.

---

_[View the full topic](https://forum.weaviate.io/t/how-to-load-existing-db-to-similarity-search/3309)._
