-
Notifications
You must be signed in to change notification settings - Fork 54
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
Support proper updates in StringIndex #3
Comments
Hi @dylanrb123 |
Hi @karchx, I updated the description of the issue to make it more clear. I'm not sure I fully understand your question but let me know if anything is still unclear. |
@dylanrb123
|
Moving discussion about this from #64 to here. Relevant comments:
|
As mentioned above, how we would probably want to see this implemented is a bit complicated as there are performance/memory implications for this to be enabled. Let's start with how this would work in its basic form:
Some details for consideration
^ cc @dylanrb123 |
I have a WIP branch with this partially implemented using two ConcurrentHashMaps https://github.com/spotify/voyager/tree/upsert-string-index. As @markkohdev mentioned, that approach will substantially increase memory usage to support a feature that most people probably don't care about which is why I didn't finish the implementation. IMO it would be better to just wait until we pull this into the C++ code or make it configurable as Mark suggested. |
@dylanrb123 for me it's important to be able to update existing record. Now question is will you finish this the way @markkohdev suggested or should I give it a go? |
When you call
index.add
with an existing ID but a new vector, Voyager will correctly locate the correct spot in the graph to place the new vector and update all of the existing connections. However, theStringIndex
abstraction does not support this behavior. As written, the string index will add a new vector and new ID ifindex.add
is called with a name that is already present in the index, instead of updating the existing one.Instead of adding a new item and keeping the old one around, Voyager should check the existing items list and update the underlying index accordingly with the new vector value so we don't end up with duplicate items in the index.
The text was updated successfully, but these errors were encountered: