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 {