docstore.docs is empty with elastic search index #8636
Replies: 1 comment
-
🤖 Hi @amitguptadumka, Good to see you again! From your description, it seems like you're trying to view all indexed chunks from Elastic Search when The Here's the relevant code snippet from the @property
def docs(self) -> Dict[str, BaseNode]:
"""Get all documents.
Returns:
Dict[str, BaseDocument]: documents
"""
json_dict = self._kvstore.get_all(collection=self._node_collection)
return {key: json_to_doc(json) for key, json in json_dict.items()} (Source: llama_index/storage/docstore/keyval_docstore.py) Regarding the Here's the function definition: @classmethod
def from_vector_store(
cls,
vector_store: VectorStore,
service_context: Optional[ServiceContext] = None,
**kwargs: Any,
) -> "VectorStoreIndex":
if not vector_store.stores_text:
raise ValueError(
"Cannot initialize from a vector store that does not store text."
)
storage_context = StorageContext.from_defaults(vector_store=vector_store)
return cls(
nodes=[], service_context=service_context, storage_context=storage_context
) (Source: llama_index/indices/vector_store/base.py) I hope this helps! If you have any other questions or need further clarification, feel free to ask. Best, Sources
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot. |
Beta Was this translation helpful? Give feedback.
-
Hi,
When i am loading index from local storage(Faiss) i am able to call :
docstore=index.docstore and can see all documents using docstore.docs
Now, when i load index from Elastic Search(as below), docstore.docs is empty
index = VectorStoreIndex.from_vector_store(
vector_store=vector_store_ins,
storage_context=storage_context_ins_es,
service_context=service_context_ins_es
)
docstore=index.docstore
print(docstore.docs)
How to view all indexed chunks from ES?
Beta Was this translation helpful? Give feedback.
All reactions