-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Document insertion fails in Weaviate Vector Store when metadata is included #14504
Comments
The issue you're encountering with inserting documents with metadata into the Weaviate Vector Store likely stems from how metadata is handled during the insertion process. Here are some steps and suggestions to help debug and resolve this issue:
By following these steps, you should be able to identify and resolve the issue with inserting documents with metadata into the Weaviate Vector Store. If the problem persists, further investigation into the specific metadata structure and Weaviate's handling of metadata may be necessary [1][2]. |
The issue here is the space on the property name.
This will work: llama_index_doc = Document(doc_id='12345',
text=text,
metadata={
"title_of_parental_document": "Regression analysis",
"source": "https://en.wikipedia.org/wiki/Regression_analysis"
}) The issue with that code is the name of one of the metadata. It is not adherent to a what Weaviate expects: for instance: I believe we could add something here that would normalize the property name to be according to what Weaviate supports. |
Thank you so much @dudanogueira! |
Bug Description
Hello,
While I was trying to use the Weaviate Vector Store, I found that when I try to insert a Document with metadata to it, then it is not actually inserted into the vector store. Note that no exception or warning is raised. You can detect the failure only if you try to print the contents of the vector store or use a retriever.
If the Document does not contain metadata, then the insertion is complete and the retriever can search on the document's chunks. We have talk with @logan-markewich on Discord, and the issue is probably connected with the Weaviate issue #5202.
Version
0.10.51 (llama-index)
1.0.0 (llama-index-vector-stores-weaviate)
4.6.5 (weaviate-client)
Steps to Reproduce
Create a Weaviate vector store index and then try to insert a document with metadata and one without metadata. Then use a retriever to retrieve the nodes or use the Weaviate method for listing the collection's contents and check if the ones from the document with metadata are included in the results. The following Python code is extracted from a Jupyter Notebook to showcase the steps to reproduce.
The text was updated successfully, but these errors were encountered: