mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-27 11:51:08 +00:00
Adding community title and description searching. Fixes #589
This commit is contained in:
parent
134e8c1c94
commit
4a1f744211
1 changed files with 5 additions and 1 deletions
|
@ -180,7 +180,11 @@ impl<'a> CommunityQueryBuilder<'a> {
|
||||||
let mut query = self.query;
|
let mut query = self.query;
|
||||||
|
|
||||||
if let Some(search_term) = self.search_term {
|
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
|
// The view lets you pass a null user_id, if you're not logged in
|
||||||
|
|
Loading…
Reference in a new issue