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/tag filter): tag search filter exclude the tag_rel is deleted

kumfob529bd8b8e5a
diff --git a/internal/repo/search_common/search_repo.go b/internal/repo/search_common/search_repo.go
index 5488f891..f2b79696 100644
--- a/internal/repo/search_common/search_repo.go
+++ b/internal/repo/search_common/search_repo.go
@@ -135,8 +135,8 @@ func (sr *searchRepo) SearchContents(ctx context.Context, words []string, tagIDs
ast + ".tag_id": tagID,
ast + ".status": entity.TagRelStatusAvailable,
})
- argsQ = append(argsQ, tagID, entity.TagRelStatusAvailable)
- argsA = append(argsA, tagID, entity.TagRelStatusAvailable)
+ argsQ = append(argsQ, entity.TagRelStatusAvailable, tagID)
+ argsA = append(argsA, entity.TagRelStatusAvailable, tagID)
}
}
@@ -252,7 +252,7 @@ func (sr *searchRepo) SearchQuestions(ctx context.Context, words []string, tagID
ast + ".tag_id": tagID,
ast + ".status": entity.TagRelStatusAvailable,
})
- args = append(args, tagID, entity.TagRelStatusAvailable)
+ args = append(args, entity.TagRelStatusAvailable, tagID)
}
}
@@ -365,7 +365,7 @@ func (sr *searchRepo) SearchAnswers(ctx context.Context, words []string, tagIDs
ast + ".tag_id": tagID,
ast + ".status": entity.TagRelStatusAvailable,
})
- args = append(args, tagID, entity.TagRelStatusAvailable)
+ args = append(args, entity.TagRelStatusAvailable, tagID)
}
}