-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Elastic Search Vector Store - Unable to Add Documents #2857
Comments
🤖 Hello, From the code snippet you've provided, it seems like you're correctly using the However, it's important to note that the Here's how you can modify your code to ensure that the promise is fully resolved before checking the vector store: const ids = await vectorStore.addDocuments(docs);
console.log("Docs loaded...."+ids.length);
// Wait for the promise to resolve
await Promise.all(ids.map(id => vectorStore.getDocument(id)));
// Now check the vector store for the documents This code uses the If you're still not seeing the documents in the vector store after making this modification, it's possible that there's an issue with the Elasticsearch setup. Please double-check your Elasticsearch configuration and make sure that it's correctly set up to work with the LangChainJS framework. I hope this helps! Let me know if you have any other questions. 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. |
Update:: when the metadata is removed the insertion is successful. docs.forEach((doc) => {
doc.metadata = {};
}); |
🤖 Hello, Based on the context provided, it seems like the issue you're facing is similar to a previously solved issue in the LangChainJS repository. The issue was titled "Opensearch store does not support object in metadata and fail silently" and it was resolved by either not supporting objects in metadata or by throwing an appropriate error so that the client is aware of the problem. The problem you're encountering might be due to the Elastic Search Vector Store not being configured to handle metadata. To resolve this, you need to ensure that the Elastic Search Vector Store is properly configured to handle metadata. This can be done by modifying the mapping of the Elastic Search index to include the metadata field. Here's a general guide on how to modify the mapping of an index in Elastic Search: https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-put-mapping.html Unfortunately, without the code for the As for the structure of the If the issue persists, it could be due to other factors such as network issues, incorrect Elastic Search configuration, or issues with the documents themselves. In such cases, it would be helpful to check the error message returned by Elastic Search for more information. I hope this helps! If you have any more questions or need further clarification, feel free to ask. 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. |
@ezimuel would you be able to have a look at this? |
Unable to add documents to Elastic Search Vector Store.
There is no error logged and the
ids
array is non-null, but the underlying vector store has no documents.Full Code
The text was updated successfully, but these errors were encountered: