Filter_removed_comments_from_search (#4634)

* filter_removed_comments_from_search

* Revert "filter_removed_comments_from_search"

This reverts commit c6d6490afa.

* filtering_removed_comments_search

* filter_deleted_comments

* Revert "filter_deleted_comments"

This reverts commit 7dc1d13d24.

* Revert "filtering_removed_comments_search"

This reverts commit 6e9b1de7a2.

* filtering_removed_dELeted_comments_search
This commit is contained in:
tracyspacy 2024-04-22 17:33:02 +02:00 committed by GitHub
parent c31a29ec7f
commit 0eaf8d33e7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -215,9 +215,14 @@ fn queries<'a>() -> Queries<
if let Some(parent_path) = options.parent_path.as_ref() { if let Some(parent_path) = options.parent_path.as_ref() {
query = query.filter(comment::path.contained_by(parent_path)); 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 { 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 { if let Some(community_id) = options.community_id {