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 ng...@apache.org on 2020/04/06 17:05:19 UTC

svn commit: r1876192 - /jackrabbit/oak/trunk/oak-benchmarks/src/main/java/org/apache/jackrabbit/oak/benchmark/PropertyFullTextTest.java

Author: ngupta
Date: Mon Apr  6 17:05:19 2020
New Revision: 1876192

URL: http://svn.apache.org/viewvc?rev=1876192&view=rev
Log:
OAK-8996 | Lucene indexing benchmarks fail in case of wiki imports of > 100000 nodes

Modified:
    jackrabbit/oak/trunk/oak-benchmarks/src/main/java/org/apache/jackrabbit/oak/benchmark/PropertyFullTextTest.java

Modified: jackrabbit/oak/trunk/oak-benchmarks/src/main/java/org/apache/jackrabbit/oak/benchmark/PropertyFullTextTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-benchmarks/src/main/java/org/apache/jackrabbit/oak/benchmark/PropertyFullTextTest.java?rev=1876192&r1=1876191&r2=1876192&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-benchmarks/src/main/java/org/apache/jackrabbit/oak/benchmark/PropertyFullTextTest.java (original)
+++ jackrabbit/oak/trunk/oak-benchmarks/src/main/java/org/apache/jackrabbit/oak/benchmark/PropertyFullTextTest.java Mon Apr  6 17:05:19 2020
@@ -17,9 +17,11 @@
 package org.apache.jackrabbit.oak.benchmark;
 
 
+import com.google.common.collect.ImmutableList;
 import org.apache.jackrabbit.oak.api.Tree;
 import org.apache.jackrabbit.oak.benchmark.wikipedia.WikipediaImport;
 import org.apache.jackrabbit.oak.commons.PathUtils;
+import org.apache.jackrabbit.oak.plugins.index.IndexUtils;
 import org.apache.jackrabbit.oak.plugins.tree.factories.TreeFactory;
 import org.apache.jackrabbit.oak.spi.lifecycle.RepositoryInitializer;
 import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
@@ -177,6 +179,12 @@ public class PropertyFullTextTest extend
             if (!isAlreadyThere(builder)) {
                 Tree t = TreeFactory.createTree(builder.child(INDEX_DEFINITIONS_NAME));
                 t.setProperty("jcr:primaryType", "nt:unstructured", NAME);
+
+                NodeBuilder uuid = IndexUtils.createIndexDefinition(builder.child(INDEX_DEFINITIONS_NAME), "uuid", true, true,
+                        ImmutableList.<String>of("jcr:uuid"), null);
+                uuid.setProperty("info",
+                        "Oak index for UUID lookup (direct lookup of nodes with the mixin 'mix:referenceable').");
+
                 t = t.addChild(name);
                 t.setProperty("jcr:primaryType", INDEX_DEFINITIONS_NODE_TYPE, NAME);
                 t.setProperty(COMPAT_MODE, 2L, LONG);
@@ -308,7 +316,7 @@ public class PropertyFullTextTest extend
         // persisted state.
         ec.session.refresh(true);
         QueryManager qm = ec.session.getWorkspace().getQueryManager();
-        Query q = qm.createQuery("SELECT * FROM [nt:base] WHERE [title] = '" + ec.title + "'", Query.JCR_SQL2);
+        Query q = qm.createQuery("SELECT * FROM [nt:base] WHERE [title] = \"" + ec.title + "\"", Query.JCR_SQL2);
         LOG.trace("statement: {} - title: {}", q.getStatement(), ec.title);
         RowIterator rows = q.execute().getRows();
         if (rows.hasNext()) {