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

Add remove method #652

Open
jharding opened this issue Feb 6, 2014 · 1 comment
Open

Add remove method #652

jharding opened this issue Feb 6, 2014 · 1 comment
Milestone

Comments

@jharding
Copy link
Contributor

jharding commented Feb 6, 2014

Asked about in #647.

@milotoor
Copy link

This would be really useful to have implemented, but I do see the difficulty involved given the structure of the search index. You can't just pop something out of the index's "datums" array without updating the ids of, in the worst case, virtually every single node in the trie. Given that, I'm inclined to agree with @addremove's suggestion (see #946) that an associative array might be a better avenue for organizing the data.

Why not do this:

  • convert the datums array into an object
  • modify this line, computing the id of the datum with some hashing function
  • add the datum into the datums object using its computed id

Of course anywhere else in the search index that leverages datum ids would have to be modified as well.

That would skirt the issue of having ids vulnerable to removal, as there is now no need to completely traverse the trie upon updates to the data. I'm happy to take a stab at implementing this, but your input would be very helpful, @jharding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants