From e2a75db67f74044077060ab45c3be0c3ef97dda1 Mon Sep 17 00:00:00 2001 From: MidoriKurage Date: Thu, 6 Aug 2026 10:28:53 +0800 Subject: [PATCH] chore(types): add internal only ContentRevision to types.SearchResult --- internal/application/service/chat_pipeline/search_entity.go | 1 + internal/application/service/knowledgebase_search_results.go | 1 + internal/types/search.go | 5 +++++ 3 files changed, 7 insertions(+) diff --git a/internal/application/service/chat_pipeline/search_entity.go b/internal/application/service/chat_pipeline/search_entity.go index 90415e3a..85cecd40 100644 --- a/internal/application/service/chat_pipeline/search_entity.go +++ b/internal/application/service/chat_pipeline/search_entity.go @@ -211,6 +211,7 @@ func chunk2SearchResult(chunk *types.Chunk, knowledge *types.Knowledge) *types.S return &types.SearchResult{ ID: chunk.ID, Content: chunk.Content, + ContentRevision: chunk.ContentRevision, KnowledgeID: chunk.KnowledgeID, ChunkIndex: chunk.ChunkIndex, KnowledgeTitle: knowledge.Title, diff --git a/internal/application/service/knowledgebase_search_results.go b/internal/application/service/knowledgebase_search_results.go index 9c8e068c..549479bd 100644 --- a/internal/application/service/knowledgebase_search_results.go +++ b/internal/application/service/knowledgebase_search_results.go @@ -309,6 +309,7 @@ func (s *knowledgeBaseService) buildSearchResult(chunk *types.Chunk, return &types.SearchResult{ ID: chunk.ID, Content: chunk.Content, + ContentRevision: chunk.ContentRevision, KnowledgeID: chunk.KnowledgeID, ChunkIndex: chunk.ChunkIndex, KnowledgeTitle: knowledge.Title, diff --git a/internal/types/search.go b/internal/types/search.go index e9009bea..2f7d9ab1 100644 --- a/internal/types/search.go +++ b/internal/types/search.go @@ -207,6 +207,11 @@ type SearchResult struct { // KnowledgeBaseID is the ID of the knowledge base this result belongs to KnowledgeBaseID string `json:"knowledge_base_id,omitempty"` + + // ContentRevision is the chunk edit revision at retrieval time. + // Internal only: used by the merge pipeline to decide whether source + // coordinates are still trustworthy. + ContentRevision int `json:"-"` } // SearchParams represents the search parameters