From: Dessalines Date: Wed, 7 Sep 2022 08:58:41 +0000 (-0400) Subject: Don't search for community descriptions, search for user display_name. (#2430) X-Git-Url: http://these/git/%22https:/nerdica.net/README.es.md?a=commitdiff_plain;h=3f2a689edfddeb847753b44e7a42057de19ebbae;p=lemmy.git Don't search for community descriptions, search for user display_name. (#2430) - https://github.com/LemmyNet/lemmy-ui/issues/756 --- diff --git a/crates/db_views_actor/src/community_view.rs b/crates/db_views_actor/src/community_view.rs index 0171e067..0701ab43 100644 --- a/crates/db_views_actor/src/community_view.rs +++ b/crates/db_views_actor/src/community_view.rs @@ -140,8 +140,7 @@ impl<'a> CommunityQuery<'a> { let searcher = fuzzy_search(&search_term); query = query .filter(community::name.ilike(searcher.to_owned())) - .or_filter(community::title.ilike(searcher.to_owned())) - .or_filter(community::description.ilike(searcher)); + .or_filter(community::title.ilike(searcher)); }; match self.sort.unwrap_or(SortType::Hot) { diff --git a/crates/db_views_actor/src/person_view.rs b/crates/db_views_actor/src/person_view.rs index 5fae93ca..35044469 100644 --- a/crates/db_views_actor/src/person_view.rs +++ b/crates/db_views_actor/src/person_view.rs @@ -70,7 +70,10 @@ impl<'a> PersonQuery<'a> { .into_boxed(); if let Some(search_term) = self.search_term { - query = query.filter(person::name.ilike(fuzzy_search(&search_term))); + let searcher = fuzzy_search(&search_term); + query = query + .filter(person::name.ilike(searcher.to_owned())) + .or_filter(person::display_name.ilike(searcher)); } query = match self.sort.unwrap_or(SortType::Hot) {