Adding community title and description searching. Fixes #589

This commit is contained in:
Dessalines 2020-03-08 19:14:52 -04:00
parent e7ba29c3c6
commit ac95bdd8b5

View file

@ -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