Skip to content

Save and Load Index from Disk #8

@OmarMGaber

Description

@OmarMGaber

Description

Add support to save the current in-memory index to disk and reload it automatically when the engine starts. This avoids rebuilding the index every time the system restarts.


Why

  • Currently, the index exists only in memory and is lost on terminating.
  • Re-indexing on every startup is totaly inefficient, especially for large datasets.

What to Add

  • A function to serialize and save the index to disk (e.g., using Go’s encoding/gob).
  • A function to load the index from disk on startup if exists.
  • Automatically call load/save during startup/shutdown of the engine.

Example

//                    load/save index path
engine := engine.NewEngine(......, "index.gob")
err := engine.SaveIndex()
err := engine.LoadIndex()

Metadata

Metadata

Assignees

No one assigned

    Labels

    coreCore feature must be implmentedenhancementNew feature or request
    No fields configured for Feature.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions