Skip to content

Commit

Permalink
Try fix for elastic search exeptions
Browse files Browse the repository at this point in the history
  • Loading branch information
Jupiterrr committed Oct 5, 2015
1 parent a1d4825 commit 90ae36b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/search/sanitize_string.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ def self.sanitize_string(str)
# Escape special characters
# http://lucene.apache.org/core/old_versioned_docs/versions/2_9_1/queryparsersyntax.html#Escaping Special Characters
escaped_characters = Regexp.escape('\\+-&|!(){}[]^~*?:\/')
str = str.gsub(/([#{escaped_characters}])/, '\\\\\1')
str = str.gsub(/([#{escaped_characters}])/, ' ')
# str = str.gsub(/([#{escaped_characters}])/, '\\\\\1')

# AND, OR and NOT are used by lucene as logical operators. We need
# to escape them
Expand Down

0 comments on commit 90ae36b

Please sign in to comment.