Class MarkdownIndexService

java.lang.Object
sk.iway.iwcm.rag.service.MarkdownIndexService

@Service public class MarkdownIndexService extends Object
Incrementally indexes Markdown sources and removes deleted files after a successful directory scan.
  • Field Details

    • SHARED_DOMAIN_ID

      public static final int SHARED_DOMAIN_ID
      Storage domain for shared documentation; assistants and token usage retain their owning domain.
      See Also:
  • Constructor Details

  • Method Details

    • indexConfiguredRoots

      public void indexConfiguredRoots(String folder)
      Scans globally configured roots shared by all domains. A failed root is retried on the next run. The caller's domain supplies the assistant and owns usage; only source configuration and storage are shared.
      Parameters:
      folder - optional configured root to scan, or null to scan all roots
    • processQueueItem

      public void processQueueItem(IndexQueueEntity item)
      Processes a shared file using the queue's accounting domain; failures are propagated for retry. Deletion actions and missing files remove existing chunks from shared storage.
      Parameters:
      item - queued action with a configured source path, matching entity ID, and positive accounting domain
      Throws:
      IllegalArgumentException - if the queued source, action, or accounting domain is invalid
      IllegalStateException - if indexing is already running or reading, embedding, or vector-store preparation fails