itemsapi / itemsjs

Extremely fast faceted search engine in JavaScript - lightweight, flexible, and simple to use

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Persistence of index

jzakotnik opened this issue · comments

Is there a way to persist an existing itemjs index and reload it again for search later? This would be a great enhancement.

If I see it correctly, the index is built via lunr, so the serialisation might also be possible

This is an excellent suggestion. Implementing serialization of the search index could potentially result even a 10x performance improvement during reindexing operations, such as when a user refreshes the page. The serialized index could be stored locally using localStorage or as a file on the server side for persistence.

There's a notable parallel here with how pandas can swiftly load Parquet files, which, despite containing the same data as CSV files, are loaded significantly faster due to their optimized format. I'm curious to see how much of a performance gain we could achieve in this context with JavaScript.

I'd be interested to hear if this aligns with your thoughts or if there's anything you might want to add.