diff options
author | multiple creatures <dev@multiple-creature.party> | 2019-12-13 00:43:20 -0600 |
---|---|---|
committer | multiple creatures <dev@multiple-creature.party> | 2019-12-13 00:43:20 -0600 |
commit | 4b0612c11db1ff2f2206b23d16586f6c3c31e2af (patch) | |
tree | 9240fa54cd581e6ae7856040bbf8466447937d25 /app/helpers/search_helper.rb | |
parent | a547f442e02562f33b26a4a473bcc847bde4e48e (diff) |
improve normalization
Diffstat (limited to 'app/helpers/search_helper.rb')
-rw-r--r-- | app/helpers/search_helper.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/helpers/search_helper.rb b/app/helpers/search_helper.rb index 9510abe99..8bddbe187 100644 --- a/app/helpers/search_helper.rb +++ b/app/helpers/search_helper.rb @@ -3,7 +3,8 @@ require 'sixarm_ruby_unaccent' module SearchHelper def expand_search_query(query) return '' if query.blank? - query = query.strip.downcase.unaccent + query = query.downcase.unaccent.gsub(/[^\p{Word} [:punct:]]/, '').gsub(/ +/, ' ').strip + return '' if query.blank? if query.include?(':') query_parts = query.split(':', 2) |