chore(types): add internal only ContentRevision to types.SearchResult

This commit is contained in:
MidoriKurage
2026-08-06 10:28:53 +08:00
committed by lyingbug
parent 6b0d8d1057
commit e2a75db67f
3 changed files with 7 additions and 0 deletions
@@ -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,
@@ -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,
+5
View File
@@ -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