feat: 增强FAQ搜索功能,支持指定搜索字段(标准问题/相似问法/答案)

This commit is contained in:
wizardchen
2025-12-24 13:11:54 +08:00
parent e45b82e9be
commit 0bbd1450cc
10 changed files with 36 additions and 14 deletions
+3 -2
View File
@@ -2549,6 +2549,7 @@ func (s *knowledgeService) CloneChunk(ctx context.Context, src, dst *types.Knowl
"",
"",
"",
"",
)
chunkPage++
if err != nil {
@@ -2643,7 +2644,7 @@ func (s *knowledgeService) CloneChunk(ctx context.Context, src, dst *types.Knowl
// ListFAQEntries lists FAQ entries under a FAQ knowledge base.
func (s *knowledgeService) ListFAQEntries(ctx context.Context,
kbID string, page *types.Pagination, tagID string, keyword string, sortOrder string,
kbID string, page *types.Pagination, tagID string, keyword string, searchField string, sortOrder string,
) (*types.PageResult, error) {
if page == nil {
page = &types.Pagination{}
@@ -2663,7 +2664,7 @@ func (s *knowledgeService) ListFAQEntries(ctx context.Context,
}
chunkType := []types.ChunkType{types.ChunkTypeFAQ}
chunks, total, err := s.chunkRepo.ListPagedChunksByKnowledgeID(
ctx, tenantID, faqKnowledge.ID, page, chunkType, tagID, keyword, sortOrder,
ctx, tenantID, faqKnowledge.ID, page, chunkType, tagID, keyword, searchField, sortOrder,
)
if err != nil {
return nil, err