You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by ch...@apache.org on 2014/10/31 06:35:02 UTC
svn commit: r1635672 - in /jackrabbit/oak/branches/1.0: ./
oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/LucenePropertyIndexTest.java
Author: chetanm
Date: Fri Oct 31 05:35:01 2014
New Revision: 1635672
URL: http://svn.apache.org/r1635672
Log:
OAK-2190 - Support for like query for string
Merging r1631711
Modified:
jackrabbit/oak/branches/1.0/ (props changed)
jackrabbit/oak/branches/1.0/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/LucenePropertyIndexTest.java
Propchange: jackrabbit/oak/branches/1.0/
------------------------------------------------------------------------------
Merged /jackrabbit/oak/trunk:r1631711
Modified: jackrabbit/oak/branches/1.0/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/LucenePropertyIndexTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/branches/1.0/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/LucenePropertyIndexTest.java?rev=1635672&r1=1635671&r2=1635672&view=diff
==============================================================================
--- jackrabbit/oak/branches/1.0/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/LucenePropertyIndexTest.java (original)
+++ jackrabbit/oak/branches/1.0/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/LucenePropertyIndexTest.java Fri Oct 31 05:35:01 2014
@@ -38,6 +38,7 @@ import org.apache.jackrabbit.oak.spi.com
import org.apache.jackrabbit.oak.spi.query.QueryIndexProvider;
import org.apache.jackrabbit.oak.spi.security.OpenSecurityProvider;
import org.apache.jackrabbit.util.ISO8601;
+import org.junit.Ignore;
import org.junit.Test;
import static com.google.common.collect.ImmutableSet.of;
@@ -188,6 +189,23 @@ public class LucenePropertyIndexTest ext
assertQuery("select [jcr:path] from [nt:base] where [propa] > "+ dt("15/02/2014") + " and [propa] < " + dt("13/04/2014"), asList("/test/b"));
}
+ @Ignore("OAK-2190")
+ @Test
+ public void likeQueriesWithString() throws Exception {
+ Tree idx = createIndex("test1", of("propa", "propb"));
+ idx.addChild("propa");
+ root.commit();
+
+ Tree test = root.getTree("/").addChild("test");
+ test.addChild("a").setProperty("propa", "humpty");
+ test.addChild("b").setProperty("propa", "dumpty");
+ test.addChild("c").setProperty("propa", "humpy");
+ root.commit();
+
+ assertQuery("select [jcr:path] from [nt:base] where propa like 'hum%'", asList("/test/a", "test/c"));
+ assertQuery("select [jcr:path] from [nt:base] where propa like '%ty'", asList("/test/a", "/test/b"));
+ }
+
//TODO Test for range with Date. Check for precision
private String explain(String query){