From 55d6bc727401399bb7b26b81768223be0a600f67 Mon Sep 17 00:00:00 2001 From: wizardchen Date: Mon, 24 Nov 2025 15:50:55 +0800 Subject: [PATCH] fix: Update chunk repository queries to use indexed chunk status --- internal/application/repository/chunk.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/application/repository/chunk.go b/internal/application/repository/chunk.go index b8f46d49..bd4bf889 100644 --- a/internal/application/repository/chunk.go +++ b/internal/application/repository/chunk.go @@ -82,7 +82,7 @@ func (r *chunkRepository) ListPagedChunksByKnowledgeID( query := r.db.WithContext(ctx).Model(&types.Chunk{}). Where("tenant_id = ? AND knowledge_id = ? AND chunk_type IN (?) AND status in (?)", - tenantID, knowledgeID, chunkType, []types.ChunkStatus{types.ChunkStatusStored, types.ChunkStatusDefault}) + tenantID, knowledgeID, chunkType, []types.ChunkStatus{types.ChunkStatusIndexed, types.ChunkStatusDefault}) if tagID != "" { query = query.Where("tag_id = ?", tagID) } @@ -96,7 +96,7 @@ func (r *chunkRepository) ListPagedChunksByKnowledgeID( dataQuery := r.db.WithContext(ctx). Select("id, content, knowledge_id, knowledge_base_id, start_at, end_at, chunk_index, is_enabled, chunk_type, parent_chunk_id, image_info, metadata, tag_id") dataQuery = dataQuery.Where("tenant_id = ? AND knowledge_id = ? AND chunk_type IN (?) AND status in (?)", - tenantID, knowledgeID, chunkType, []types.ChunkStatus{types.ChunkStatusStored, types.ChunkStatusDefault}) + tenantID, knowledgeID, chunkType, []types.ChunkStatus{types.ChunkStatusIndexed, types.ChunkStatusDefault}) if tagID != "" { dataQuery = dataQuery.Where("tag_id = ?", tagID) }