Find answers from the community

Updated 6 months ago

Hello,

At a glance

The community member asked how to load a Qdrant index that has been created. The first comment suggests passing the collection name to the QdrantVectorStore and StorageContext to load the index. However, another community member noted that this might lead to duplicating the vectors stored in the database.

The third comment provided two options to load the index without passing the documents again: VectorStoreIndex.from_documents([], storage_context=storage_context) or VectorStoreIndex(storage_context=storage_context). The community members acknowledged that this solved the issue.

Hello,
How can I load my qdrant index once it has been created, is there a load_index_from_storage kind of function ?
W
T
5 comments
You will have to pass the collection name I think.

Plain Text
vector_store = QdrantVectorStore(client=client, collection_name="paul_graham")
storage_context = StorageContext.from_defaults(vector_store=vector_store)
index = VectorStoreIndex.from_documents(
    documents,
    storage_context=storage_context,
)


If you pass the same collection name where embeddings were ingested in the first place , it will only be used
I might be wrong, but when I do this with the same initial documents, it’s duplicating the vectors stored in the db
You are passing the documents everytime.
Try doing this:
Plain Text
# option A
index = VectorStoreIndex.from_documents(
    [],
    storage_context=storage_context,
)

# Option B
index = VectorStoreIndex(
    storage_context=storage_context,
)
Thanks, I feel a bit stupid now 🫣
No worries, glad it is solved
Add a reply
Sign up and join the conversation on Discord