jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexparvule...@apache.org
Subject svn commit: r1524667 - in /jackrabbit/oak/trunk/oak-core/src: main/java/org/apache/jackrabbit/oak/query/fulltext/FullTextTerm.java test/java/org/apache/jackrabbit/oak/query/index/TraversingIndexQueryTest.java
Date Thu, 19 Sep 2013 09:31:45 GMT
Author: alexparvulescu
Date: Thu Sep 19 09:31:44 2013
New Revision: 1524667

URL: http://svn.apache.org/r1524667
Log:
OAK-1024 Full-text search on the traversing index fails if the condition contains a slash


Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/fulltext/FullTextTerm.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/index/TraversingIndexQueryTest.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/fulltext/FullTextTerm.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/fulltext/FullTextTerm.java?rev=1524667&r1=1524666&r2=1524667&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/fulltext/FullTextTerm.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/fulltext/FullTextTerm.java
Thu Sep 19 09:31:44 2013
@@ -67,7 +67,7 @@ public class FullTextTerm extends FullTe
                 } else if (c == '_') {
                     buff.append("\\_");
                     pattern = true;
-                } else if (Character.isLetterOrDigit(c) || " +-:&".indexOf(c) >= 0)
{
+                } else if (Character.isLetterOrDigit(c) || " +-:&/".indexOf(c) >=
0) {
                     buff.append(c);
                 }
             }

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/index/TraversingIndexQueryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/index/TraversingIndexQueryTest.java?rev=1524667&r1=1524666&r2=1524667&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/index/TraversingIndexQueryTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/index/TraversingIndexQueryTest.java
Thu Sep 19 09:31:44 2013
@@ -15,11 +15,14 @@ package org.apache.jackrabbit.oak.query.
 
 import org.apache.jackrabbit.oak.Oak;
 import org.apache.jackrabbit.oak.api.ContentRepository;
+import org.apache.jackrabbit.oak.api.Tree;
 import org.apache.jackrabbit.oak.plugins.nodetype.write.InitialContent;
 import org.apache.jackrabbit.oak.query.AbstractQueryTest;
 import org.apache.jackrabbit.oak.spi.security.OpenSecurityProvider;
 import org.junit.Test;
 
+import com.google.common.collect.ImmutableList;
+
 /**
  * Tests the query engine using the default index implementation: the
  * {@link TraversingIndex}
@@ -44,4 +47,13 @@ public class TraversingIndexQueryTest ex
         test("sql2.txt");
     }
 
+    @Test
+    public void testFullTextTerm() throws Exception {
+        //OAK-1024 allow '/' in a full-text query 
+        Tree node = root.getTree("/").addChild("content");
+        node.setProperty("jcr:mimeType", "text/plain");
+        assertQuery("//*[jcr:contains(., 'text/plain')]", "xpath",
+                ImmutableList.of("/content"));
+    }
+
 }



Mime
View raw message