Skip to content
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

Allow ElasticVectorSearch#add_texts to explicitely set the _ids #5437

Closed
lemig opened this issue May 30, 2023 · 2 comments
Closed

Allow ElasticVectorSearch#add_texts to explicitely set the _ids #5437

lemig opened this issue May 30, 2023 · 2 comments

Comments

@lemig
Copy link

lemig commented May 30, 2023

Issue you'd like to raise.

ElasticVectorSearch currently assigns a uuid as identifier while indexing documents.
This is not idempotent: if we run the code twice duplicates are created.
Also it would be beneficial to be able to insert new docs, update existing ones and ignore unchanged.

Suggestion:

I propose to check first if _id or id is present in metadata before setting it to a UUID.

@lemig
Copy link
Author

lemig commented May 31, 2023

As suggested by @dev2049, pass ids: Optional[List[str]] = None

Like in #5190

@dosubot
Copy link

dosubot bot commented Sep 3, 2023

Hi, @lemig! I'm Dosu, and I'm here to help the LangChain team manage their backlog. I wanted to let you know that we are marking this issue as stale.

From what I understand, you raised an issue about allowing ElasticVectorSearch#add_texts to set the _ids explicitly instead of assigning a UUID as the identifier. This would prevent duplicates and allow for inserting new documents, updating existing ones, and ignoring unchanged ones. There has been a comment by you suggesting to pass ids: Optional[List[str]] = None, as suggested by @dev2049 in issue #5190.

Before we close this issue, we wanted to check with you if it is still relevant to the latest version of the LangChain repository. If it is, please let us know by commenting on the issue. Otherwise, feel free to close the issue yourself or it will be automatically closed in 7 days.

Thank you for your contribution to the LangChain repository!

@dosubot dosubot bot added the stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed label Sep 3, 2023
@dosubot dosubot bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 10, 2023
@dosubot dosubot bot removed the stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed label Sep 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant