olivernn / lunr.js

A bit like Solr, but much smaller and not as bright
http://lunrjs.com
MIT License
8.94k stars 548 forks source link

How to integrate indexeddb or pouchdb or watermelondb to save index??? #425

Closed prog20901 closed 4 years ago

prog20901 commented 4 years ago

How to integrate indexeddb or pouchdb or watermelondb to save index???

I don't want to accept files from user every time...I don't want to create index everytime...However the user will have files locally...It should be indexed offline and search offline..

Please let me know whether we can store the files in above db, store the lunr.js created index in the above and does the search everytime...

Lunr.js is awesome but wanted to know the above..Please help

hoelzro commented 4 years ago

@prog20901 One thing you could do is use lunr's JSON serialization/deserialization functionality as described here to build up the index, and then use whatever storage API (whether that be indexeddb, local storage, etc) to retrieve the stored index on page load.

prog20901 commented 4 years ago

Thanks a lot...