-
Notifications
You must be signed in to change notification settings - Fork 55
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
Added getNumElements + getVector #64
Conversation
Added getNumElements Added getVector
Added getNumElements Added getVector
Added getNumElements Added getVector
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @samek thanks for another contribution! You're now a star supporter of this OSS project :) haha
Exposing getNumElements
and getVector
are 👍
In regards to upserting, after chatting with @dylanrb123 about this change, we don't think that this approach is how we would like to see this implemented. The implementation you have here results in traversal of the entire names
list upon every addition in the worst case.
In order to support upserting functionality I think we would need a slightly more involved solution. I'll be implementing StringIndex
in the C++ core soon enough and will implement this functionality there (and deprecate this class).
I would recommend removing the upsert functionality for the moment and reducing the scope of this PR. However, if you are very motivated to enable this functionality before StringIndex support in voyager core comes along we can discuss how we might support this using a naive implementation in Java (effectively utilizing parallel HashMaps instead of an ArrayList for managing the strings)
Ok, I've removed the functionality. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As reported in issues #3 inserting string vector with the same name doesn't update it but it adds another one.
I've modified inserting so that it checks for the key before adding it to the index.
If this change is not wanted I could maybe create upsertItem upsertItems which would perform this way.