jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tomm...@apache.org
Subject svn commit: r1462023 - in /jackrabbit/oak/trunk/oak-solr-core/src: main/java/org/apache/jackrabbit/oak/plugins/index/solr/index/ main/java/org/apache/jackrabbit/oak/plugins/index/solr/query/ test/java/org/apache/jackrabbit/oak/plugins/index/solr/query/
Date Thu, 28 Mar 2013 10:33:21 GMT
Author: tommaso
Date: Thu Mar 28 10:33:20 2013
New Revision: 1462023

URL: http://svn.apache.org/r1462023
Log:
OAK-725 - applied Emanuele's patch for fixed query handling for sql2 coverage

Modified:
    jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/index/SolrIndexUpdate.java
    jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/query/SolrQueryIndex.java
    jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/query/SolrIndexQueryTest.java

Modified: jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/index/SolrIndexUpdate.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/index/SolrIndexUpdate.java?rev=1462023&r1=1462022&r2=1462023&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/index/SolrIndexUpdate.java
(original)
+++ jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/index/SolrIndexUpdate.java
Thu Mar 28 10:33:20 2013
@@ -63,8 +63,8 @@ public class SolrIndexUpdate implements 
 
     public void insert(String path, NodeBuilder value) {
         Preconditions.checkArgument(path.startsWith(this.path));
-        if (!insert.containsKey(path)) {
-            String key = path.substring(this.path.length());
+        String key = path.substring(this.path.length());
+        if (!insert.containsKey(key)) {
             if ("".equals(key)) {
                 key = "/";
             }

Modified: jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/query/SolrQueryIndex.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/query/SolrQueryIndex.java?rev=1462023&r1=1462022&r2=1462023&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/query/SolrQueryIndex.java
(original)
+++ jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/query/SolrQueryIndex.java
Thu Mar 28 10:33:20 2013
@@ -95,9 +95,9 @@ public class SolrQueryIndex implements Q
                 if (path.equals("\\/") && pathRestriction.equals(Filter.PathRestriction.ALL_CHILDREN))
{
                     queryBuilder.append("*");
                 } else {
-//                    queryBuilder.append("\"");
+                    queryBuilder.append("\"");
                     queryBuilder.append(path);
-//                    queryBuilder.append("\"");
+                    queryBuilder.append("\"");
                 }
                 queryBuilder.append(" ");
             }
@@ -105,7 +105,10 @@ public class SolrQueryIndex implements Q
         Collection<Filter.PropertyRestriction> propertyRestrictions = filter.getPropertyRestrictions();
         if (propertyRestrictions != null && !propertyRestrictions.isEmpty()) {
             for (Filter.PropertyRestriction pr : propertyRestrictions) {
-
+            	if (pr.propertyName.contains("/")) {
+                    // lucene cannot handle child-level property restrictions
+                    continue;
+                }
                 String first = null;
                 if (pr.first != null) {
                     first = partialEscape(String.valueOf(pr.first.getValue(pr.first.getType()))).toString();
@@ -146,7 +149,9 @@ public class SolrQueryIndex implements Q
         for (String fulltextCondition : fulltextConditions) {
             queryBuilder.append(fulltextCondition).append(" ");
         }
-
+        if(queryBuilder.length() == 0) {
+            queryBuilder.append("*:*");
+        }
         String escapedQuery = queryBuilder.toString();
         solrQuery.setQuery(escapedQuery);
 

Modified: jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/query/SolrIndexQueryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/query/SolrIndexQueryTest.java?rev=1462023&r1=1462022&r2=1462023&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/query/SolrIndexQueryTest.java
(original)
+++ jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/query/SolrIndexQueryTest.java
Thu Mar 28 10:33:20 2013
@@ -23,8 +23,6 @@ import org.apache.jackrabbit.oak.api.Con
 import org.apache.jackrabbit.oak.api.Tree;
 import org.apache.jackrabbit.oak.plugins.index.solr.OakSolrConfiguration;
 import org.apache.jackrabbit.oak.plugins.index.solr.TestUtils;
-import org.apache.jackrabbit.oak.plugins.index.solr.server.OakSolrNodeStateConfiguration;
-import org.apache.jackrabbit.oak.plugins.memory.PropertyStates;
 import org.apache.jackrabbit.oak.plugins.nodetype.write.InitialContent;
 import org.apache.jackrabbit.oak.query.AbstractQueryTest;
 import org.apache.jackrabbit.oak.query.JsopUtil;
@@ -42,7 +40,8 @@ import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 
 /**
- * General query extensive testcase for {@link org.apache.jackrabbit.oak.plugins.index.solr.query.SolrQueryIndex}
and {@link org.apache.jackrabbit.oak.plugins.index.solr.index.SolrIndexDiff}
+ * General query extensive testcase for {@link SolrQueryIndex} and {@link
+ * org.apache.jackrabbit.oak.plugins.index.solr.index.SolrIndexDiff}
  */
 public class SolrIndexQueryTest extends AbstractQueryTest {
 
@@ -83,7 +82,6 @@ public class SolrIndexQueryTest extends 
     }
 
     @Test
-    @Ignore("failing")
     public void sql2() throws Exception {
         test("sql2.txt");
     }



Mime
View raw message