jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thom...@apache.org
Subject svn commit: r1349886 - in /jackrabbit/oak/trunk/oak-core/src: main/java/org/apache/jackrabbit/oak/core/ main/java/org/apache/jackrabbit/oak/query/ main/java/org/apache/jackrabbit/oak/query/ast/ main/java/org/apache/jackrabbit/oak/query/index/ main/java...
Date Wed, 13 Jun 2012 14:43:57 GMT
Author: thomasm
Date: Wed Jun 13 14:43:56 2012
New Revision: 1349886

URL: http://svn.apache.org/viewvc?rev=1349886&view=rev
Log:
OAK-34 Define query API (simplify the Cursor interface; use the oak-core Tree implementation)

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ContentRepositoryImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/Query.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/AstElement.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/FullTextSearchImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/JoinImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/PropertyValueImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/SelectorImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/SourceImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/PropertyContentIndex.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/TraversingCursor.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/Cursor.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/AbstractQueryTest.java
    jackrabbit/oak/trunk/oak-core/src/test/resources/org/apache/jackrabbit/oak/query/queryTest.txt

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ContentRepositoryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ContentRepositoryImpl.java?rev=1349886&r1=1349885&r2=1349886&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ContentRepositoryImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ContentRepositoryImpl.java
Wed Jun 13 14:43:56 2012
@@ -71,6 +71,7 @@ public class ContentRepositoryImpl imple
      */
     public ContentRepositoryImpl() {
         this(new MicroKernelImpl(), null, null);
+        // this(new IndexWrapper(new MicroKernelImpl()), null, null);
     }
 
     /**
@@ -79,6 +80,7 @@ public class ContentRepositoryImpl imple
      *
      * @param microKernel underlying kernel instance
      * @param indexProvider index provider
+     * @param validatorProvider the validation provider
      */
     public ContentRepositoryImpl(MicroKernel microKernel, QueryIndexProvider indexProvider,
             ValidatorProvider validatorProvider) {
@@ -112,7 +114,7 @@ public class ContentRepositoryImpl imple
     }
 
     private static QueryIndexProvider getDefaultIndexProvider(MicroKernel mk) {
-        return new Indexer(mk);
+        return Indexer.getInstance(mk);
     }
 
     @Nonnull

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/Query.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/Query.java?rev=1349886&r1=1349885&r2=1349886&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/Query.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/Query.java
Wed Jun 13 14:43:56 2012
@@ -23,6 +23,7 @@ import org.apache.jackrabbit.mk.api.Micr
 import org.apache.jackrabbit.oak.api.ContentSession;
 import org.apache.jackrabbit.oak.api.CoreValue;
 import org.apache.jackrabbit.oak.api.CoreValueFactory;
+import org.apache.jackrabbit.oak.api.Tree;
 import org.apache.jackrabbit.oak.namepath.NamePathMapper;
 import org.apache.jackrabbit.oak.query.ast.AstVisitorBase;
 import org.apache.jackrabbit.oak.query.ast.BindVariableValueImpl;
@@ -506,4 +507,8 @@ public class Query {
         return namePathMapper;
     }
 
+    public Tree getTree(String path) {
+        return session.getCurrentRoot().getTree(path);
+    }
+
 }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/AstElement.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/AstElement.java?rev=1349886&r1=1349885&r2=1349886&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/AstElement.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/AstElement.java
Wed Jun 13 14:43:56 2012
@@ -22,6 +22,7 @@ import org.apache.jackrabbit.mk.json.Jso
 import org.apache.jackrabbit.mk.json.JsopTokenizer;
 import org.apache.jackrabbit.oak.api.CoreValue;
 import org.apache.jackrabbit.oak.api.CoreValueFactory;
+import org.apache.jackrabbit.oak.api.Tree;
 import org.apache.jackrabbit.oak.kernel.CoreValueMapper;
 import org.apache.jackrabbit.oak.namepath.NamePathMapper;
 import org.apache.jackrabbit.oak.query.Query;
@@ -125,5 +126,9 @@ abstract class AstElement {
         return p;
     }
 
+    protected Tree getTree(String path) {
+        return query.getTree(path);
+    }
+
 }
 

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/FullTextSearchImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/FullTextSearchImpl.java?rev=1349886&r1=1349885&r2=1349886&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/FullTextSearchImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/FullTextSearchImpl.java
Wed Jun 13 14:43:56 2012
@@ -20,8 +20,9 @@ package org.apache.jackrabbit.oak.query.
 
 import java.text.ParseException;
 import java.util.ArrayList;
-import org.apache.jackrabbit.mk.simple.NodeImpl;
 import org.apache.jackrabbit.oak.api.CoreValue;
+import org.apache.jackrabbit.oak.api.PropertyState;
+import org.apache.jackrabbit.oak.api.Tree;
 import org.apache.jackrabbit.oak.query.index.FilterImpl;
 
 public class FullTextSearchImpl extends ConstraintImpl {
@@ -88,13 +89,9 @@ public class FullTextSearchImpl extends 
             }
             return evaluateContains(v);
         }
-        NodeImpl n = selector.currentNode();
-        for (int i = 0; i < n.getPropertyCount(); i++) {
-            String p = n.getProperty(i);
-            if (p == null) {
-                break;
-            }
-            CoreValue v = selector.currentProperty(p);
+        Tree tree = getTree(selector.currentPath());
+        for (PropertyState p : tree.getProperties()) {
+            CoreValue v = selector.currentProperty(p.getName());
             if (evaluateContains(v)) {
                 return true;
             }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/JoinImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/JoinImpl.java?rev=1349886&r1=1349885&r2=1349886&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/JoinImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/JoinImpl.java
Wed Jun 13 14:43:56 2012
@@ -14,7 +14,6 @@
 package org.apache.jackrabbit.oak.query.ast;
 
 import org.apache.jackrabbit.mk.api.MicroKernel;
-import org.apache.jackrabbit.mk.simple.NodeImpl;
 import org.apache.jackrabbit.oak.query.Query;
 
 public class JoinImpl extends SourceImpl {
@@ -173,9 +172,4 @@ public class JoinImpl extends SourceImpl
         return left.currentPath();
     }
 
-    @Override
-    public NodeImpl currentNode() {
-        return null;
-    }
-
 }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/PropertyValueImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/PropertyValueImpl.java?rev=1349886&r1=1349885&r2=1349886&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/PropertyValueImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/PropertyValueImpl.java
Wed Jun 13 14:43:56 2012
@@ -18,8 +18,8 @@
  */
 package org.apache.jackrabbit.oak.query.ast;
 
-import org.apache.jackrabbit.mk.simple.NodeImpl;
 import org.apache.jackrabbit.oak.api.CoreValue;
+import org.apache.jackrabbit.oak.api.Tree;
 import org.apache.jackrabbit.oak.commons.PathUtils;
 import org.apache.jackrabbit.oak.query.index.FilterImpl;
 
@@ -59,22 +59,21 @@ public class PropertyValueImpl extends D
             return selector.currentProperty(propertyName);
         }
         // TODO really support relative properties?
-        NodeImpl n = selector.currentNode();
+        Tree tree = getTree(selector.currentPath());
         for (String p : PathUtils.elements(PathUtils.getParentPath(propertyName))) {
-            if (n == null) {
+            if (tree == null) {
                 return null;
             }
-            if (!n.exists(p)) {
+            if (!tree.hasChild(p)) {
                 return null;
             }
-            n = n.getNode(p);
+            tree = tree.getChild(p);
         }
         String name = PathUtils.getName(propertyName);
-        if (!n.hasProperty(name)) {
+        if (!tree.hasProperty(name)) {
             return null;
         }
-        String value = n.getProperty(name);
-        return getCoreValue(value);
+        return tree.getProperty(name).getValue();
     }
 
     public void bindSelector(SourceImpl source) {

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/SelectorImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/SelectorImpl.java?rev=1349886&r1=1349885&r2=1349886&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/SelectorImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/SelectorImpl.java
Wed Jun 13 14:43:56 2012
@@ -19,8 +19,9 @@
 package org.apache.jackrabbit.oak.query.ast;
 
 import org.apache.jackrabbit.mk.api.MicroKernel;
-import org.apache.jackrabbit.mk.simple.NodeImpl;
 import org.apache.jackrabbit.oak.api.CoreValue;
+import org.apache.jackrabbit.oak.api.PropertyState;
+import org.apache.jackrabbit.oak.api.Tree;
 import org.apache.jackrabbit.oak.query.Query;
 import org.apache.jackrabbit.oak.query.index.FilterImpl;
 import org.apache.jackrabbit.oak.spi.Cursor;
@@ -109,12 +110,12 @@ public class SelectorImpl extends Source
             if (nodeTypeName.equals(TYPE_BASE)) {
                 return true;
             }
-            NodeImpl n = cursor.currentNode();
-            String primaryType = n.getProperty(JCR_PRIMARY_TYPE);
-            if (primaryType == null) {
+            Tree tree = getTree(cursor.currentPath());
+            PropertyState p = tree.getProperty(JCR_PRIMARY_TYPE);
+            if (p == null) {
                 return true;
             }
-            CoreValue v = getCoreValue(primaryType);
+            CoreValue v = p.getValue();
             // TODO node type matching
             if (nodeTypeName.equals(v.getString())) {
                 return true;
@@ -127,11 +128,6 @@ public class SelectorImpl extends Source
         return cursor == null ? null : cursor.currentPath();
     }
 
-    @Override
-    public NodeImpl currentNode() {
-        return cursor == null ? null : cursor.currentNode();
-    }
-
     public CoreValue currentProperty(String propertyName) {
         if (propertyName.equals(PATH)) {
             String p = currentPath();
@@ -145,15 +141,15 @@ public class SelectorImpl extends Source
             }
             return query.getValueFactory().createValue(local);
         }
-        NodeImpl n = currentNode();
-        if (n == null) {
+        String path = currentPath();
+        if (path == null) {
             return null;
         }
-        String value = n.getProperty(propertyName);
-        if (value == null) {
+        PropertyState p = getTree(path).getProperty(propertyName);
+        if (p == null) {
             return null;
         }
-        return getCoreValue(value);
+        return p.getValue();
     }
 
     @Override

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/SourceImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/SourceImpl.java?rev=1349886&r1=1349885&r2=1349886&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/SourceImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/SourceImpl.java
Wed Jun 13 14:43:56 2012
@@ -19,7 +19,6 @@
 package org.apache.jackrabbit.oak.query.ast;
 
 import org.apache.jackrabbit.mk.api.MicroKernel;
-import org.apache.jackrabbit.mk.simple.NodeImpl;
 import org.apache.jackrabbit.oak.query.Query;
 
 public abstract class SourceImpl extends AstElement {
@@ -108,11 +107,4 @@ public abstract class SourceImpl extends
      */
     public abstract String currentPath();
 
-    /**
-     * Get the current node.
-     *
-     * @return the node
-     */
-    public abstract NodeImpl currentNode();
-
 }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/PropertyContentIndex.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/PropertyContentIndex.java?rev=1349886&r1=1349885&r2=1349886&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/PropertyContentIndex.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/PropertyContentIndex.java
Wed Jun 13 14:43:56 2012
@@ -19,9 +19,7 @@
 package org.apache.jackrabbit.oak.query.index;
 
 import java.util.Iterator;
-import org.apache.jackrabbit.mk.api.MicroKernel;
 import org.apache.jackrabbit.mk.index.PropertyIndex;
-import org.apache.jackrabbit.mk.simple.NodeImpl;
 import org.apache.jackrabbit.oak.api.CoreValue;
 import org.apache.jackrabbit.oak.spi.Cursor;
 import org.apache.jackrabbit.oak.spi.Filter;
@@ -32,11 +30,9 @@ import org.apache.jackrabbit.oak.spi.Que
  */
 public class PropertyContentIndex implements QueryIndex {
 
-    private final MicroKernel mk;
     private final PropertyIndex index;
 
-    public PropertyContentIndex(MicroKernel mk, PropertyIndex index) {
-        this.mk = mk;
+    public PropertyContentIndex(PropertyIndex index) {
         this.index = index;
     }
 
@@ -72,7 +68,7 @@ public class PropertyContentIndex implem
         CoreValue first = restriction.first;
         String f = first == null ? null : first.toString();
         Iterator<String> it = index.getPaths(f, revisionId);
-        return new ContentCursor(mk, revisionId, it);
+        return new ContentCursor(it);
     }
 
 
@@ -86,33 +82,15 @@ public class PropertyContentIndex implem
      */
     static class ContentCursor implements Cursor {
 
-        private final MicroKernel mk;
-        private final String revisionId;
         private final Iterator<String> it;
 
         private String currentPath;
-        private NodeImpl currentNode;
 
-        public ContentCursor(MicroKernel mk, String revisionId, Iterator<String> it)
{
-            this.mk = mk;
-            this.revisionId = revisionId;
+        public ContentCursor(Iterator<String> it) {
             this.it = it;
         }
 
         @Override
-        public NodeImpl currentNode() {
-            // TODO same code as in TraversingCursor
-            if (currentNode == null) {
-                if (currentPath == null) {
-                    return null;
-                }
-                currentNode = NodeImpl.parse(mk.getNodes(currentPath, revisionId, 1, 0, -1,
null));
-                currentNode.setPath(currentPath);
-            }
-            return currentNode;
-        }
-
-        @Override
         public String currentPath() {
             return currentPath;
         }
@@ -121,7 +99,6 @@ public class PropertyContentIndex implem
         public boolean next() {
             if (it.hasNext()) {
                 currentPath = it.next();
-                currentNode = null;
                 return true;
             }
             return false;

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/TraversingCursor.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/TraversingCursor.java?rev=1349886&r1=1349885&r2=1349886&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/TraversingCursor.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/TraversingCursor.java
Wed Jun 13 14:43:56 2012
@@ -30,7 +30,6 @@ public class TraversingCursor implements
 
     private ArrayList<NodeCursor> nodes = new ArrayList<NodeCursor>();
     private String currentPath;
-    private NodeImpl currentNode;
 
     public TraversingCursor(MicroKernel mk, String revisionId, int childBlockSize, String
path) {
         this.mk = mk;
@@ -54,29 +53,12 @@ public class TraversingCursor implements
     }
 
     @Override
-    public NodeImpl currentNode() {
-        if (currentNode == null) {
-            if (currentPath == null) {
-                return null;
-            }
-            String s = mk.getNodes(currentPath, revisionId, 1, 0, -1, null);
-            if (s == null) {
-                return null;
-            }
-            currentNode = NodeImpl.parse(s);
-            currentNode.setPath(currentPath);
-        }
-        return currentNode;
-    }
-
-    @Override
     public String currentPath() {
         return currentPath;
     }
 
     @Override
     public boolean next() {
-        currentNode = null;
         if (nodes == null) {
             currentPath = null;
             return false;

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/Cursor.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/Cursor.java?rev=1349886&r1=1349885&r2=1349886&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/Cursor.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/Cursor.java
Wed Jun 13 14:43:56 2012
@@ -18,8 +18,6 @@
  */
 package org.apache.jackrabbit.oak.spi;
 
-import org.apache.jackrabbit.mk.simple.NodeImpl;
-
 /**
  * A cursor to read a number of nodes sequentially.
  */
@@ -39,11 +37,4 @@ public interface Cursor {
      */
     String currentPath();
 
-    /**
-     * The current node.
-     *
-     * @return the node
-     */
-    NodeImpl currentNode();
-
 }

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/AbstractQueryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/AbstractQueryTest.java?rev=1349886&r1=1349885&r2=1349886&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/AbstractQueryTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/AbstractQueryTest.java
Wed Jun 13 14:43:56 2012
@@ -16,10 +16,8 @@
  */
 package org.apache.jackrabbit.oak.query;
 
-import org.apache.jackrabbit.mk.api.MicroKernel;
 import org.apache.jackrabbit.mk.core.MicroKernelImpl;
 import org.apache.jackrabbit.mk.index.IndexWrapper;
-import org.apache.jackrabbit.mk.index.Indexer;
 import org.apache.jackrabbit.oak.api.ContentSession;
 import org.apache.jackrabbit.oak.api.CoreValueFactory;
 import org.apache.jackrabbit.oak.api.QueryEngine;
@@ -39,10 +37,8 @@ public abstract class AbstractQueryTest 
     protected final ContentSession session;
 
     {
-        MicroKernel rawMk = new MicroKernelImpl();
-        mk = new IndexWrapper(rawMk);
-        Indexer indexer = mk.getIndexer();
-        rep = new ContentRepositoryImpl(mk, indexer, null);
+        mk = new IndexWrapper(new MicroKernelImpl());
+        rep = new ContentRepositoryImpl(mk, null, null);
         try {
             session = rep.login(new GuestCredentials(), "default");
             vf = session.getCoreValueFactory();

Modified: jackrabbit/oak/trunk/oak-core/src/test/resources/org/apache/jackrabbit/oak/query/queryTest.txt
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/resources/org/apache/jackrabbit/oak/query/queryTest.txt?rev=1349886&r1=1349885&r2=1349886&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/resources/org/apache/jackrabbit/oak/query/queryTest.txt
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/resources/org/apache/jackrabbit/oak/query/queryTest.txt
Wed Jun 13 14:43:56 2012
@@ -44,6 +44,18 @@ nt:base AS nt:base /* traverse "//*" */
 commit / - "test"
 commit /jcr:system/indexes - "property@id,unique"
 
+# fulltext search
+
+commit / + "test": { "name": "hello world" }
+
+select * from [nt:base] where contains(name, 'hello')
+/test
+
+select * from [nt:base] where contains(*, 'hello')
+/test
+
+commit / - "test"
+
 # other tests
 
 commit / + "test": { "jcr:resource": {}, "resource": { "x" : {}}}



Mime
View raw message