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

    Function updateIntelligenceIndex

    • Scan the news directory, rebuild the intelligence index from article metadata, and persist the updated index to disk.

      Starts from a fresh empty index on every call so that articles that have been deleted or renamed are automatically pruned — no stale entries can survive.

      Each article file is parsed to extract its date, type, language, and metadata. The resulting ArticleIndexEntry objects are accumulated into an IntelligenceIndex whose trend detections are refreshed on every call.

      Parameters

      • newsDir: string = NEWS_DIR

        News directory to scan for article HTML files

      • indexPath: string = INTELLIGENCE_INDEX_PATH

        Path to the intelligence index JSON file

      Returns IntelligenceIndex

      The rebuilt IntelligenceIndex