Package sk.iway.iwcm.rag.service
Class MarkdownIndexService
java.lang.Object
sk.iway.iwcm.rag.service.MarkdownIndexService
Incrementally indexes Markdown sources and removes deleted files after a successful directory scan.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intStorage domain for shared documentation; assistants and token usage retain their owning domain. -
Constructor Summary
ConstructorsConstructorDescriptionMarkdownIndexService(MarkdownSourceService sources, MarkdownContentExtractor extractor, MarkdownChunker chunker, EmbeddingService embeddings, RagEmbeddingStatService statistics, EmbeddingChunkRepository repository, VectorStore vectorStore) -
Method Summary
Modifier and TypeMethodDescriptionvoidindexConfiguredRoots(String folder) Scans globally configured roots shared by all domains.voidProcesses a shared file using the queue's accounting domain; failures are propagated for retry.
-
Field Details
-
SHARED_DOMAIN_ID
public static final int SHARED_DOMAIN_IDStorage domain for shared documentation; assistants and token usage retain their owning domain.- See Also:
-
-
Constructor Details
-
MarkdownIndexService
public MarkdownIndexService(MarkdownSourceService sources, MarkdownContentExtractor extractor, MarkdownChunker chunker, EmbeddingService embeddings, RagEmbeddingStatService statistics, EmbeddingChunkRepository repository, VectorStore vectorStore)
-
-
Method Details
-
indexConfiguredRoots
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
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 invalidIllegalStateException- if indexing is already running or reading, embedding, or vector-store preparation fails
-