From 0eaf8d33e7d811954a49ba95d7012adc50b0092b Mon Sep 17 00:00:00 2001 From: tracyspacy <42025315+tracyspacy@users.noreply.github.com> Date: Mon, 22 Apr 2024 17:33:02 +0200 Subject: [PATCH] Filter_removed_comments_from_search (#4634) * filter_removed_comments_from_search * Revert "filter_removed_comments_from_search" This reverts commit c6d6490afa923a666b96c785a776711ef42baed7. * filtering_removed_comments_search * filter_deleted_comments * Revert "filter_deleted_comments" This reverts commit 7dc1d13d24f0300ae17cecdf13abbfba24ac9a06. * Revert "filtering_removed_comments_search" This reverts commit 6e9b1de7a21a03caed3b2832fbf5d09c204b7994. * filtering_removed_dELeted_comments_search --- crates/db_views/src/comment_view.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/crates/db_views/src/comment_view.rs b/crates/db_views/src/comment_view.rs index e8957e1e9..910c37406 100644 --- a/crates/db_views/src/comment_view.rs +++ b/crates/db_views/src/comment_view.rs @@ -215,9 +215,14 @@ fn queries<'a>() -> Queries< if let Some(parent_path) = options.parent_path.as_ref() { query = query.filter(comment::path.contained_by(parent_path)); }; - + //filtering out removed and deleted comments from search if let Some(search_term) = options.search_term { - query = query.filter(comment::content.ilike(fuzzy_search(&search_term))); + query = query.filter( + comment::content + .ilike(fuzzy_search(&search_term)) + .and(comment::removed.eq(false)) + .and(comment::deleted.eq(false)), + ); }; if let Some(community_id) = options.community_id {