package org.dromara.knowledge.retrieval;

import lombok.RequiredArgsConstructor;
import org.dromara.knowledge.service.KnowledgeDocumentService;
import org.springframework.stereotype.Component;

@Component
@RequiredArgsConstructor
public class DefaultIndexUpdater implements IndexUpdater {
    private final KnowledgeDocumentService knowledgeDocumentService;

    @Override
    public String updateFragments(String knowledgeId, String docId) {
        // 触发分片重建，依赖 KnowledgeDocumentService 的分片逻辑
        // 返回任务ID用于追踪
        return knowledgeDocumentService.processDocumentContent(knowledgeId, docId, "", null);
    }
}

