feat(knowledge): enhance FAQ entry filtering and tagging
- Updated the listFAQEntries function to support multiple tag IDs for filtering. - Modified the frontend components to accommodate the new tag_ids parameter. - Enhanced the KbTagManageDrawer and FAQEntryManager components to reflect changes in tag handling. - Improved API documentation to clarify the new tag filtering capabilities. This commit enhances the flexibility of FAQ entry retrieval, allowing users to filter by multiple tags for more precise results.
This commit is contained in:
@@ -31,7 +31,7 @@ type ChunkRepository interface {
|
||||
// ListChunksByKnowledgeID lists chunks by knowledge id
|
||||
ListChunksByKnowledgeID(ctx context.Context, tenantID uint64, knowledgeID string) ([]*types.Chunk, error)
|
||||
// ListPagedChunksByKnowledgeID lists paged chunks by knowledge id.
|
||||
// When tagID is non-empty, results are filtered by tag_id.
|
||||
// When tagIDs is non-empty, results are filtered by tag_id (OR semantics).
|
||||
// knowledgeType: "faq" or "manual" - determines sort order and search behavior
|
||||
// - FAQ: sorts by updated_at, searchField can be "standard_question", "similar_questions", "answers", or "" for all
|
||||
// - Document (manual): sorts by chunk_index, keyword searches content only
|
||||
@@ -43,7 +43,7 @@ type ChunkRepository interface {
|
||||
knowledgeID string,
|
||||
page *types.Pagination,
|
||||
chunkType []types.ChunkType,
|
||||
tagID string,
|
||||
tagIDs []string,
|
||||
keyword string,
|
||||
searchField string,
|
||||
sortOrder string,
|
||||
|
||||
@@ -119,14 +119,15 @@ type KnowledgeService interface {
|
||||
// UpdateImageInfo updates image information for a knowledge chunk.
|
||||
UpdateImageInfo(ctx context.Context, knowledgeID string, chunkID string, imageInfo string) error
|
||||
// ListFAQEntries lists FAQ entries under a FAQ knowledge base.
|
||||
// When tagSeqID is non-zero, results are filtered by tag seq_id on FAQ chunks.
|
||||
// When tagUUIDs is non-empty, results are filtered by tag UUID on FAQ chunks (OR semantics).
|
||||
// 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)
|
||||
ListFAQEntries(
|
||||
ctx context.Context,
|
||||
kbID string,
|
||||
page *types.Pagination,
|
||||
tagSeqID int64,
|
||||
tagUUIDs []string,
|
||||
legacyTagSeqID int64,
|
||||
keyword string,
|
||||
searchField string,
|
||||
sortOrder string,
|
||||
|
||||
Reference in New Issue
Block a user