Commit ca94709f74956635a04a4d9656b5e73706d47476
1 parent
a65775c7
Exists in
master
and in
29 other branches
ActionItem128: search now filter stopwords preserving only those protected with quotes
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1199 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
2 changed files
with
2 additions
and
1 deletions
Show diff stats
app/helpers/search_helper.rb
... | ... | @@ -12,6 +12,6 @@ module SearchHelper |
12 | 12 | end |
13 | 13 | |
14 | 14 | def remove_stop_words(query) |
15 | - (query.downcase.split(/[ '".]/) - STOP_WORDS[Locale.current.to_s]).join(' ') | |
15 | + (query.downcase.scan(/"[^"]*"?|'[^']*'?|[^'"\s]+/) - STOP_WORDS[Locale.current.to_s]).join(' ') | |
16 | 16 | end |
17 | 17 | end | ... | ... |
test/functional/search_controller_test.rb