refactor: simplify document deletion logic and remove redundant chunk handling

This commit is contained in:
mlogclub
2026-06-02 11:33:24 +08:00
parent 7a2f673a02
commit 62c55f5a47
2 changed files with 4 additions and 13 deletions
-4
View File
@@ -120,10 +120,6 @@ func (s *index) IndexFAQByID(ctx context.Context, faqID int64) error {
func (s *index) RemoveDocumentIndex(ctx context.Context, documentID int64) error {
chunks := repositories.KnowledgeChunkRepository.FindByDocumentID(sqls.DB(), documentID)
return s.RemoveDocumentIndexByChunks(ctx, documentID, chunks)
}
func (s *index) RemoveDocumentIndexByChunks(ctx context.Context, documentID int64, chunks []models.KnowledgeChunk) error {
if len(chunks) == 0 {
return nil
}