]> Untitled Git - lemmy.git/commitdiff
Don't search for community descriptions, search for user display_name. (#2430)
authorDessalines <dessalines@users.noreply.github.com>
Wed, 7 Sep 2022 08:58:41 +0000 (04:58 -0400)
committerGitHub <noreply@github.com>
Wed, 7 Sep 2022 08:58:41 +0000 (08:58 +0000)
- https://github.com/LemmyNet/lemmy-ui/issues/756

crates/db_views_actor/src/community_view.rs
crates/db_views_actor/src/person_view.rs

index 0171e067f5007a9157a5b39611921bc04b377f6c..0701ab430592c2e799f965b71218dfa84a5ba935 100644 (file)
@@ -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) {
index 5fae93ca807ff986b148f049cef9015d5aa8bac9..35044469b3839167ed42bcb296a29ff099827235 100644 (file)
@@ -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) {