Find answers from the community

Updated 2 months ago

I try to insert documents in a qdrant collection. The collection doesn't exist yet in my q



I try to insert documents in a qdrant collection. The collection doesn't exist yet in my qdrant cluster.
I use this code :

service_context = ServiceContext.from_defaults(llm=llm, embed_model=embedding_model)
vector_store = QdrantVectorStore(client=client, collection_name="RAG_llama_index_small_to_big")

But when I query my qdrant client it appears that the collection "RAG_llama_index_small_to_big" doesn't exist.
Should I create it before trying to insert, or does QdrantVectorStore create it if it doesn't exist yet ?
k
L
3 comments
Please stand by @tatanfort as I search the knowledge base. I normally take about 20 seconds or so. :wave:
----------------------
Based on the information provided in the extracts, it's not explicitly stated whether the QdrantVectorStore creates a new collection if it doesn't exist. However, in typical usage, the QdrantVectorStore is initialized with a QdrantClient and a collection_name.

Here is an example of how it's done:

Plain Text
client = qdrant_client.QdrantClient(
    location=":memory:"
)
vector_store = QdrantVectorStore(client=client, collection_name="paul_graham")

(Source: QdrantIndexDemo ())

If the collection doesn't exist after running your code, it's possible that you might need to create the collection manually before inserting documents. However, without explicit information from the documentation or the code extracts, it's hard to say for certain.

I would recommend checking the Qdrant documentation or the qdrant-client package documentation for more details on how collections are handled.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
It might not show up until you actualla add data? Unsure, but it's always worked fine for me
Add a reply
Sign up and join the conversation on Discord