Encode special characters in term
authorDennis Schafroth <dennis@indexdata.com>
Fri, 15 Jul 2011 13:47:55 +0000 (15:47 +0200)
committerDennis Schafroth <dennis@indexdata.com>
Fri, 15 Jul 2011 13:47:55 +0000 (15:47 +0200)
src/rpn2solr.c

index 11abe87..70b2f6c 100644 (file)
@@ -254,9 +254,9 @@ static int rpn2solr_simple(solr_transform_t ct,
             /* Bug 2878: Check and add Truncation */
                        if (checkForLeftTruncation(apt->attributes))
                 wrbuf_puts(w, "*");
-                       /* BUG 4415: Escape : (as \:) in string terms */
                        for (i = 0 ; i < lterm; i++) {
-                           if (sterm[i] == ':') {
+                /* BUG 4415: Escape special characters in string terms */
+                           if (strchr("+-&|!(){}[]^\"~*?:\\", sterm[i])) {
                               wrbuf_putc(w, '\\');
                            }
                            wrbuf_putc(w, sterm[i]);