Commit 0f6fe179a78eb53f9399c5c13dbbc10d2e6b0afb
1 parent
3b35e215
Exists in
master
and in
27 other branches
[search-improvements] Default suggestions like search match suffixes too
Showing
1 changed file
with
1 additions
and
1 deletions
Show diff stats
lib/noosfero/plugin.rb
| ... | ... | @@ -527,7 +527,7 @@ class Noosfero::Plugin |
| 527 | 527 | def find_suggestions(query, context, asset, options={:limit => 5}) |
| 528 | 528 | context.search_terms. |
| 529 | 529 | where(:asset => asset). |
| 530 | - where("search_terms.term like ?", "#{query}%"). | |
| 530 | + where("search_terms.term like ?", "%#{query}%"). | |
| 531 | 531 | where('search_terms.score > 0'). |
| 532 | 532 | order('search_terms.score DESC'). |
| 533 | 533 | limit(options[:limit]).map(&:term) | ... | ... |