jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r889564 - in /jackrabbit/trunk/jackrabbit-core/src: main/java/org/apache/jackrabbit/core/query/lucene/JackrabbitQueryParser.java test/java/org/apache/jackrabbit/core/query/FulltextQueryTest.java
Date Fri, 11 Dec 2009 10:37:16 GMT
Author: mreutegg
Date: Fri Dec 11 10:37:15 2009
New Revision: 889564

URL: http://svn.apache.org/viewvc?rev=889564&view=rev
Log:
JCR-2432: Escape colon in statement of jcr:contains

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/JackrabbitQueryParser.java
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/FulltextQueryTest.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/JackrabbitQueryParser.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/JackrabbitQueryParser.java?rev=889564&r1=889563&r2=889564&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/JackrabbitQueryParser.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/JackrabbitQueryParser.java
Fri Dec 11 10:37:15 2009
@@ -83,6 +83,9 @@
                     rewritten.append("\\");
                 }
                 rewritten.append('~');
+            } else if (textsearch.charAt(i) == ':') {
+                // fields as known in lucene are not supported
+                rewritten.append("\\:");
             } else {
                 if (escaped) {
                     rewritten.append('\\');

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/FulltextQueryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/FulltextQueryTest.java?rev=889564&r1=889563&r2=889564&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/FulltextQueryTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/FulltextQueryTest.java
Fri Dec 11 10:37:15 2009
@@ -16,7 +16,6 @@
  */
 package org.apache.jackrabbit.core.query;
 
-import java.io.IOException;
 import java.io.InputStream;
 
 import javax.jcr.Node;
@@ -26,8 +25,6 @@
 import javax.jcr.query.Query;
 import javax.jcr.query.QueryResult;
 
-import org.apache.commons.io.IOUtils;
-
 /**
  * Performs tests with the <code>CONTAINS</code> function.
  */
@@ -266,6 +263,10 @@
         executeContainsQuery("max&moritz", content, true);
     }
 
+    public void testColonInContains() throws RepositoryException {
+        executeContainsQuery("foo:bar", "foo:bar", true);
+    }
+
     /**
      * Executes a query and checks if the query matched the test node.
      *



Mime
View raw message