From 3f2a689edfddeb847753b44e7a42057de19ebbae Mon Sep 17 00:00:00 2001 From: Dessalines Date: Wed, 7 Sep 2022 04:58:41 -0400 Subject: [PATCH] Don't search for community descriptions, search for user display_name. (#2430) - https://github.com/LemmyNet/lemmy-ui/issues/756 --- crates/db_views_actor/src/community_view.rs | 3 +-- crates/db_views_actor/src/person_view.rs | 5 ++++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/crates/db_views_actor/src/community_view.rs b/crates/db_views_actor/src/community_view.rs index 0171e067f..0701ab430 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 5fae93ca8..35044469b 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) {