8000 Will indexes remain immutable? · Issue #13 · bleroy/lunr-core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Will indexes remain immutable? #13

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

Closed
drittich opened this issue Aug 2, 2020 · 2 comments
Closed

Will indexes remain immutable? #13

drittich opened this issue Aug 2, 2020 · 2 comments

Comments

@drittich
Copy link
drittich commented Aug 2, 2020

I noticed that lunr.js has decided on immutable indexes. Does lunr-core intend to adhere to this design goal? IMO, while feature parity with lunr.js is a laudable goal (and the point of this whole package even), the inability to add or remove individual documents reduces the usefulness of lunr-core server-side where lunr.js may not be used at all, and rebuilding the entire index for each document add/change/delete is not practical.

@bleroy
Copy link
Owner
bleroy commented Aug 3, 2020

Not necessarily. At this point it's a plain port so it does whatever lunr.js does.

@danielcrenna
Copy link
Contributor
danielcrenna commented Jan 1, 2021

@drittich

The mutable disk-based index (via LMDB) is merged to main, you can use it now and let me know what you think in terms of how to approach mutable documents.

Right now, it can be used to persist pre-built indexes to disk for later referencing, and the data structures (fields, field vectors, and inverted index entries), can be added independently via LmdbIndex.

I'm still thinking about how to rebalance the index efficiently when documents are added or removed, as rebuilding the entire thing doesn't get us much further along.

(It's probably going to look like an API that takes Document and converts it into its component structures and mutates the data in place. But I'm not an expert in how lunr-js works, so I don't know what to expect in terms of statistics or rebalancing or pruning the B-tree)

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

No branches or pull requests

3 participants
0