Skip to content

A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.

fix: search all contents haven't result

kumfo04062afeac0f
diff --git a/internal/repo/search_common/search_repo.go b/internal/repo/search_common/search_repo.go
index 5b1487be..43df3382 100644
--- a/internal/repo/search_common/search_repo.go
+++ b/internal/repo/search_common/search_repo.go
@@ -155,7 +155,7 @@ func (sr *searchRepo) SearchContents(ctx context.Context, words []string, tagIDs
if err != nil {
return
}
- sql := fmt.Sprintf("(%s UNION ALL %s)", ubSQL, bSQL)
+ sql := fmt.Sprintf("(%s UNION ALL %s)", bSQL, ubSQL)
countSQL, _, err := builder.MySQL().Select("count(*) total").From(sql, "c").ToSQL()
if err != nil {