lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sha...@apache.org
Subject svn commit: r1634044 - in /lucene/dev/branches/lucene_solr_4_10: ./ solr/ solr/core/ solr/core/src/java/org/apache/solr/handler/component/ solr/core/src/test/org/apache/solr/ solr/core/src/test/org/apache/solr/handler/component/
Date Fri, 24 Oct 2014 12:13:37 GMT
Author: shalin
Date: Fri Oct 24 12:13:37 2014
New Revision: 1634044

URL: http://svn.apache.org/r1634044
Log:
SOLR-6545: Query field list with wild card on dynamic field fails

Modified:
    lucene/dev/branches/lucene_solr_4_10/   (props changed)
    lucene/dev/branches/lucene_solr_4_10/solr/   (props changed)
    lucene/dev/branches/lucene_solr_4_10/solr/CHANGES.txt   (contents, props changed)
    lucene/dev/branches/lucene_solr_4_10/solr/core/   (props changed)
    lucene/dev/branches/lucene_solr_4_10/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java
    lucene/dev/branches/lucene_solr_4_10/solr/core/src/test/org/apache/solr/TestDistributedSearch.java
    lucene/dev/branches/lucene_solr_4_10/solr/core/src/test/org/apache/solr/handler/component/DistributedQueryComponentOptimizationTest.java

Modified: lucene/dev/branches/lucene_solr_4_10/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_4_10/solr/CHANGES.txt?rev=1634044&r1=1634043&r2=1634044&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_4_10/solr/CHANGES.txt (original)
+++ lucene/dev/branches/lucene_solr_4_10/solr/CHANGES.txt Fri Oct 24 12:13:37 2014
@@ -45,6 +45,9 @@ Bug Fixes
 
 * SOLR-6647: Bad error message when missing resource from ZK when parsing Schema (janhoy)
 
+* SOLR-6545: Query field list with wild card on dynamic field fails.
+  (Burke Webster, Xu Zhang, shalin)
+
 Other Changes
 ----------------------
 

Modified: lucene/dev/branches/lucene_solr_4_10/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_4_10/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java?rev=1634044&r1=1634043&r2=1634044&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_4_10/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java
(original)
+++ lucene/dev/branches/lucene_solr_4_10/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java
Fri Oct 24 12:13:37 2014
@@ -806,7 +806,8 @@ public class QueryComponent extends Sear
     boolean distribSinglePass = rb.req.getParams().getBool(ShardParams.DISTRIB_SINGLE_PASS,
false);
 
     if(distribSinglePass || (fields != null && fields.wantsField(keyFieldName)
-        && fields.getRequestedFieldNames() != null && Arrays.asList(keyFieldName,
"score").containsAll(fields.getRequestedFieldNames()))) {
+        && fields.getRequestedFieldNames() != null  
+        && (!fields.hasPatternMatching() && Arrays.asList(keyFieldName, "score").containsAll(fields.getRequestedFieldNames()))))
{
       sreq.purpose |= ShardRequest.PURPOSE_GET_FIELDS;
       rb.onePassDistributedQuery = true;
     }

Modified: lucene/dev/branches/lucene_solr_4_10/solr/core/src/test/org/apache/solr/TestDistributedSearch.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_4_10/solr/core/src/test/org/apache/solr/TestDistributedSearch.java?rev=1634044&r1=1634043&r2=1634044&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_4_10/solr/core/src/test/org/apache/solr/TestDistributedSearch.java
(original)
+++ lucene/dev/branches/lucene_solr_4_10/solr/core/src/test/org/apache/solr/TestDistributedSearch.java
Fri Oct 24 12:13:37 2014
@@ -17,6 +17,7 @@
 
 package org.apache.solr;
 
+import java.nio.ByteBuffer;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
@@ -353,6 +354,16 @@ public class TestDistributedSearch exten
     query("q", "id:[1 TO 5]", CommonParams.DEBUG, CommonParams.RESULTS);
     query("q", "id:[1 TO 5]", CommonParams.DEBUG, CommonParams.QUERY);
 
+    // SOLR-6545, wild card field list
+    indexr(id, "19", "text", "d", "cat_a_sS", "1" ,t1, "2");
+    commit();
+
+    rsp = query("q", "id:19", "fl", "id", "fl", "*a_sS");
+    assertFieldValues(rsp.getResults(), "id", 19);
+
+    rsp = query("q", "id:19", "fl", "id," + t1 + ",cat*");
+    assertFieldValues(rsp.getResults(), "id", 19);
+
     // Check Info is added to for each shard
     ModifiableSolrParams q = new ModifiableSolrParams();
     q.set("q", "*:*");

Modified: lucene/dev/branches/lucene_solr_4_10/solr/core/src/test/org/apache/solr/handler/component/DistributedQueryComponentOptimizationTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_4_10/solr/core/src/test/org/apache/solr/handler/component/DistributedQueryComponentOptimizationTest.java?rev=1634044&r1=1634043&r2=1634044&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_4_10/solr/core/src/test/org/apache/solr/handler/component/DistributedQueryComponentOptimizationTest.java
(original)
+++ lucene/dev/branches/lucene_solr_4_10/solr/core/src/test/org/apache/solr/handler/component/DistributedQueryComponentOptimizationTest.java
Fri Oct 24 12:13:37 2014
@@ -99,6 +99,24 @@ public class DistributedQueryComponentOp
     verifySinglePass("q", "*:*", "fl", "id", "sort", "payload desc", "rows", "20"); // id
only is optimized by default
     verifySinglePass("q", "*:*", "fl", "id,score", "sort", "payload desc", "rows", "20");
// id,score only is optimized by default
     verifySinglePass("q", "*:*", "fl", "score", "sort", "payload asc", "rows", "20", "distrib.singlePass",
"true");
+
+    // SOLR-6545, wild card field list
+    index(id, "19", "text", "d", "cat_a_sS", "1" ,"dynamic", "2", "payload", ByteBuffer.wrap(new
byte[] { (byte)0x80, 0x11, 0x33 }));
+    commit();
+
+    nonDistribRsp = query("q", "id:19", "fl", "id,*a_sS", "sort", "payload asc");
+    rsp = query("q", "id:19", "fl", "id,*a_sS", "sort", "payload asc", "distrib.singlePass",
"true");
+
+    assertFieldValues(nonDistribRsp.getResults(), "id", 19);
+    assertFieldValues(rsp.getResults(), "id", 19);
+
+    nonDistribRsp = query("q", "id:19", "fl", "id,dynamic,cat*", "sort", "payload asc");
+    rsp = query("q", "id:19", "fl", "id,dynamic,cat*", "sort", "payload asc", "distrib.singlePass",
"true");
+    assertFieldValues(nonDistribRsp.getResults(), "id", 19);
+    assertFieldValues(rsp.getResults(), "id", 19);
+
+    verifySinglePass("q", "id:19", "fl", "id,*a_sS", "sort", "payload asc", "distrib.singlePass",
"true");
+    verifySinglePass("q", "id:19", "fl", "id,dynamic,cat*", "sort", "payload asc", "distrib.singlePass",
"true");
   }
 
   private void verifySinglePass(String... q) throws SolrServerException {



Mime
View raw message