Skip to content

Commit

Permalink
In lucene 4.0 slash symbol (/) became a special character
Browse files Browse the repository at this point in the history
  • Loading branch information
anti-social committed Feb 6, 2014
1 parent b2f9e3f commit 1315cad
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions solar/util.py
Expand Up @@ -28,8 +28,8 @@

SPECIAL_WORDS = ['AND', 'OR', 'NOT', 'TO']

# See: http://lucene.apache.org/core/3_6_0/queryparsersyntax.html#Escaping%20Special%20Characters
SPECIAL_CHARACTERS = r'\+-&|!(){}[]^"~*?:'
# See: http://lucene.apache.org/core/4_0_0/queryparser/org/apache/lucene/queryparser/classic/package-summary.html#Escaping_Special_Characters
SPECIAL_CHARACTERS = r'\+-&|!(){}[]^"~*?:/'


class SafeString(binary_type):
Expand Down
4 changes: 2 additions & 2 deletions tests/test_util.py
Expand Up @@ -14,8 +14,8 @@ def test_safe_solr_input(self):
self.assertEqual(safe_solr_input('SEPARATOR'), 'SEPARATOR')
self.assertEqual(safe_solr_input(' AND one OR two OR'), ' and one or two or')
self.assertEqual(safe_solr_input('AND OR NOT TO'), 'and or not to')
self.assertEqual(safe_solr_input('\\+-&|!(){}[]^"~*?:'),
'\\\\\\+\\-\\&\\|\\!\\(\\)\\{\\}\\[\\]\\^\\"\\~\\*\\?\\:')
self.assertEqual(safe_solr_input('\\+-&|!(){}[]^"~*?:/'),
'\\\\\\+\\-\\&\\|\\!\\(\\)\\{\\}\\[\\]\\^\\"\\~\\*\\?\\:\\/')

def test_X(self):
self.assertEqual(force_unicode(X(status=0)),
Expand Down

0 comments on commit 1315cad

Please sign in to comment.