From: Dessalines Date: Sun, 8 Mar 2020 23:14:52 +0000 (-0400) Subject: Adding community title and description searching. Fixes #589 X-Git-Url: http://these/git/%22https:/join-lemmy.org/static/gitweb.css?a=commitdiff_plain;h=4a1f74421144ceda35fff73fd5f3f347bf328b75;p=lemmy.git Adding community title and description searching. Fixes #589 --- diff --git a/server/src/db/community_view.rs b/server/src/db/community_view.rs index 18ff67a8..f24c922c 100644 --- a/server/src/db/community_view.rs +++ b/server/src/db/community_view.rs @@ -180,7 +180,11 @@ impl<'a> CommunityQueryBuilder<'a> { let mut query = self.query; if let Some(search_term) = self.search_term { - query = query.filter(name.ilike(fuzzy_search(&search_term))); + let searcher = fuzzy_search(&search_term); + query = query + .filter(name.ilike(searcher.to_owned())) + .or_filter(title.ilike(searcher.to_owned())) + .or_filter(description.ilike(searcher)); }; // The view lets you pass a null user_id, if you're not logged in