Closed Zeeshan0123 closed 2 months ago
The error you're encountering, "Not existing vector name error," suggests there's a discrepancy between the vector names in your code and those expected by your Qdrant collection schema. To address this issue, ensure the following:
Verify Vector Names: Check that the vector names in your operations match the expected names in the Qdrant collection. These names are typically defined as constants in the QdrantVectorStore
class, such as DENSE_VECTOR_NAME
for dense vectors.
Collection Configuration: Make sure your collection is correctly initialized with the vector configurations that match your operations. This includes setting up both dense and sparse vectors if your application requires hybrid search capabilities.
Correct Use of Vector Names: When adding points or querying the collection, ensure the vector names used align with those defined in your collection's schema. This is crucial for operations to execute successfully.
Dynamic Vector Name Handling: If your application involves sparse vectors, be aware that the vector name might dynamically switch between SPARSE_VECTOR_NAME_OLD
and SPARSE_VECTOR_NAME
based on the collection's setup. Your code should accommodate this dynamic selection.
If these steps do not resolve the issue, it might indicate a deeper problem with how the collection was initialized or a misconfiguration in your Qdrant setup. Double-check the collection's existence, accessibility, and schema configuration.
Additionally, you mentioned using the "new version" of LlamaIndex. It's important to ensure that your version aligns with the latest or the expected version for your implementation, as solutions might vary across different versions.
To continue the conversation, mention @dosu.
@Zeeshan0123 I believe I fixed this, just update the package
pip install -U llama-index-vector-stores-qdrant
Bug Description
i am getting this error i dont khow how to solve this
Version
new version
Steps to Reproduce
from qdrant_client import QdrantClient from llama_index.vector_stores.qdrant import QdrantVectorStore from llama_index.storage.storage_context import StorageContext from llama_index import VectorStoreIndex
Initialize the Qdrant client
client = QdrantClient(url="http://localhost:6333/dashboard", prefer_grpc=False, timeout=100)
Specify the collection name
collection_name = "med_embeddings"
Check if the collection exists
if not client.collection_exists(collection_name):
If the collection doesn't exist, create it
Initialize the Qdrant vector store
vector_store = QdrantVectorStore(client=client, collection_name=collection_name, embed_model=embed_model)
Get the nodes from the documents
node_parser = MarkdownElementNodeParser(llm=None, num_workers=8) nodes = node_parser.get_nodes_from_documents(documents, progress=True)
Get the storage context
st = StorageContext.from_defaults(vector_store=vector_store)
Get the base nodes and objects
base_nodes, objects = node_parser.get_nodes_and_objects(nodes)
Create the index
recursive_index = VectorStoreIndex(nodes=base_nodes+objects, storage_context=st)
Relevant Logs/Tracbacks
No response