EU Parliament Monitor - API Documentation - v0.7.19
    Preparing search index...

    Function loadIntelligenceIndex

    • Load an IntelligenceIndex from a JSON file.

      Returns an empty index (via createEmptyIndex) if the file does not exist or cannot be parsed.

      Each loaded ArticleIndexEntry is normalised so that missing arrays and strings are filled with safe defaults, preventing crashes in downstream code that iterates over keyTopics, keyActors, etc.

      When any lookup map (actors, policyDomains, procedures) is missing or invalid but articles are present, all maps are rebuilt from the article entries so that trend detection and lookups remain correct across schema upgrades.

      Parameters

      • indexPath: string

        Absolute or relative path to the index JSON file

      Returns IntelligenceIndex

      Loaded index, or a fresh empty index on failure