diff options
author | multiple creatures <dev@multiple-creature.party> | 2020-01-10 03:45:29 -0600 |
---|---|---|
committer | multiple creatures <dev@multiple-creature.party> | 2020-01-10 03:45:29 -0600 |
commit | f03960382bd05b8570e0e3b1066545831c59138a (patch) | |
tree | e7f4b362018e17e2a475a9c2e6988b0ebd79ac5d /app/helpers/search_helper.rb | |
parent | 4c8591fbeae9054a354f955e37a95aeed369222a (diff) |
switch (back) to postgres fts engine for fast search & timeline filters
Diffstat (limited to 'app/helpers/search_helper.rb')
-rw-r--r-- | app/helpers/search_helper.rb | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/app/helpers/search_helper.rb b/app/helpers/search_helper.rb deleted file mode 100644 index 8bddbe187..000000000 --- a/app/helpers/search_helper.rb +++ /dev/null @@ -1,20 +0,0 @@ -require 'sixarm_ruby_unaccent' - -module SearchHelper - def expand_search_query(query) - return '' if query.blank? - query = query.downcase.unaccent.gsub(/[^\p{Word} [:punct:]]/, '').gsub(/ +/, ' ').strip - return '' if query.blank? - - if query.include?(':') - query_parts = query.split(':', 2) - if %w(tag tags).include?(query_parts[0]) - query = "^tag (#{query_parts[1].split.join('|')})" - elsif %w(subj text desc).include?(query_parts[0]) - query = "^#{query_parts[0]} .*#{query_parts[1]}" - end - end - - query.gsub(/"(.*)"/, '\\y\1\\y') - end -end |