fix(search): apply tag filters to knowledge search

This commit is contained in:
langcaiye
2026-07-03 10:42:54 +08:00
committed by lyingbug
parent b16cb0bb56
commit 1708d6895a
13 changed files with 363 additions and 87 deletions
+11
View File
@@ -672,6 +672,17 @@ func (s *knowledgeService) SetKnowledgeTags(ctx context.Context, knowledgeID str
return s.repo.SetKnowledgeTags(ctx, knowledgeID, tagIDs)
}
// ListKnowledgeIDsByTagIDs returns document knowledge IDs carrying any of the
// specified KB-local tags.
func (s *knowledgeService) ListKnowledgeIDsByTagIDs(
ctx context.Context,
tenantID uint64,
kbID string,
tagIDs []string,
) ([]string, error) {
return s.repo.ListIDsByTagIDs(ctx, tenantID, kbID, tagIDs)
}
// validateKnowledgeTagIDs ensures every tag exists and belongs to the given knowledge base.
func (s *knowledgeService) validateKnowledgeTagIDs(
ctx context.Context,