Skip to content

Persistence of index #140

Description

@jzakotnik

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

Activity

  1. changed the title [-]Persistence for indexj index[/-] [+]Persistence of index[/+] on Nov 24, 2023
  2. cigolpl commented on Nov 25, 2023

    @cigolpl
    Member

    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.

  3. cigolpl commented on Nov 22, 2025

    @cigolpl
    Member

    @jzakotnik it's done. It's 3-5x faster now. You can benchmark with npm run benchmark:snapshot. More details in readme. #147

  4. jzakotnik commented on Nov 22, 2025

    @jzakotnik
    Author

    Very nice, thanks a lot! Will try it out on our open source library software.

  5. cigolpl commented on Nov 22, 2025

    @cigolpl
    Member

    Hope it's gonna work for you

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions