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

This commit is contained in:
wizardchen
2025-12-24 13:13:29 +08:00
committed by lyingbug
parent 1c1033101d
commit 762a906a1b

View File

@@ -140,9 +140,10 @@ type faqSimpleResponse struct {
}
// ListFAQEntries returns paginated FAQ entries under a knowledge base.
// searchField: specifies which field to search in ("standard_question", "similar_questions", "answers", "" for all)
// sortOrder: "asc" for time ascending (updated_at ASC), default is time descending (updated_at DESC)
func (c *Client) ListFAQEntries(ctx context.Context,
knowledgeBaseID string, page, pageSize int, tagID string, keyword string, sortOrder string,
knowledgeBaseID string, page, pageSize int, tagID string, keyword string, searchField string, sortOrder string,
) (*FAQEntriesPage, error) {
path := fmt.Sprintf("/api/v1/knowledge-bases/%s/faq/entries", knowledgeBaseID)
query := url.Values{}
@@ -158,6 +159,9 @@ func (c *Client) ListFAQEntries(ctx context.Context,
if keyword != "" {
query.Add("keyword", keyword)
}
if searchField != "" {
query.Add("search_field", searchField)
}
if sortOrder != "" {
query.Add("sort_order", sortOrder)
}