VectorStoreIndex has empty index because its vectorstore stores_text attribute is true #14783
Replies: 1 comment 6 replies
-
Hey @seeifsalem! I'm here to help you with any bugs, questions, or contributions you have for the repository. Let's tackle this issue together! The design where only Here is a breakdown of the indexing process in this case:
The relevant code snippet demonstrates this process: if not self._vector_store.stores_text or self._store_nodes_override:
for node, new_id in zip(nodes_batch, new_ids):
node_without_embedding = node.copy()
node_without_embedding.embedding = None
index_struct.add_node(node_without_embedding, text_id=new_id)
self._docstore.add_documents([node_without_embedding], allow_update=True)
else:
for node, new_id in zip(nodes_batch, new_ids):
if isinstance(node, (ImageNode, IndexNode)):
node_without_embedding = node.copy()
node_without_embedding.embedding = None
index_struct.add_node(node_without_embedding, text_id=new_id)
self._docstore.add_documents([node_without_embedding], allow_update=True) This code ensures that only Regarding your use of If you find that your index is empty, it is likely because the nodes being added are not of type |
Beta Was this translation helpful? Give feedback.
-
Hello, I noticed that in VectorStoreIndex when we initiate an instance using VectorStoreIndex.from_vector_store(vector_store = vector_store) and that the vector_store instance has stores_text = True, we end up with an empty index structure. It's due to this part of the code.
In this code extracted from the VectorStoreIndex class, you can see it but I don't understand the reasoning behind and I find myself having an empty index every time because I use the ChromaVectorStore. Any idea on the reason behind this? Does this mean that my indexing is done somewhere else? My main goal is to understand how the indexing is done in my code and how I can choose my indexing methods.
This is even more peculiar, since the from_vector_store() method only accepts vector stores that store text
Beta Was this translation helpful? Give feedback.
All reactions