lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dsmi...@apache.org
Subject svn commit: r1598147 - in /lucene/dev/branches/branch_4x: ./ solr/ solr/core/ solr/core/src/java/org/apache/solr/handler/component/ExpandComponent.java solr/core/src/test/org/apache/solr/handler/component/TestExpandComponent.java
Date Wed, 28 May 2014 21:26:39 GMT
Author: dsmiley
Date: Wed May 28 21:26:39 2014
New Revision: 1598147

URL: http://svn.apache.org/r1598147
Log:
SOLR-6118: expand.sort bug for function queries; needed to sort.rewrite(searcher)

Modified:
    lucene/dev/branches/branch_4x/   (props changed)
    lucene/dev/branches/branch_4x/solr/   (props changed)
    lucene/dev/branches/branch_4x/solr/core/   (props changed)
    lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handler/component/ExpandComponent.java
    lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/handler/component/TestExpandComponent.java

Modified: lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handler/component/ExpandComponent.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handler/component/ExpandComponent.java?rev=1598147&r1=1598146&r2=1598147&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handler/component/ExpandComponent.java
(original)
+++ lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handler/component/ExpandComponent.java
Wed May 28 21:26:39 2014
@@ -79,7 +79,7 @@ import java.util.Map;
   * expand.fq=type:child (optional, overrides the main filter queries)<br/>
   * expand.field=field (mandatory if the not used with the CollapsingQParserPlugin)<br/>
   **/
-    
+
 public class ExpandComponent extends SearchComponent implements PluginInfoInitialized, SolrCoreAware
{
   public static final String COMPONENT_NAME = "expand";
   private PluginInfo info = PluginInfo.EMPTY_INFO;
@@ -200,6 +200,8 @@ public class ExpandComponent extends Sea
     }
 
     Collector collector = null;
+    if (sort != null)
+      sort = sort.rewrite(searcher);
     GroupExpandCollector groupExpandCollector = new GroupExpandCollector(values, groupBits,
collapsedSet, limit, sort);
     SolrIndexSearcher.ProcessedFilter pfilter = searcher.getProcessedFilter(null, newFilters);
     if(pfilter.postFilter != null) {

Modified: lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/handler/component/TestExpandComponent.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/handler/component/TestExpandComponent.java?rev=1598147&r1=1598146&r2=1598147&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/handler/component/TestExpandComponent.java
(original)
+++ lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/handler/component/TestExpandComponent.java
Wed May 28 21:26:39 2014
@@ -114,7 +114,7 @@ public class TestExpandComponent extends
     params.add("defType", "edismax");
     params.add("bf", "field(test_ti)");
     params.add("expand", "true");
-    params.add("expand.sort", "test_tl desc");
+    params.add("expand.sort", "test_tl desc, sub(1,1) asc");//the "sub()" just testing function
queries
     assertQ(req(params), "*[count(/response/result/doc)=2]",
         "*[count(/response/lst[@name='expanded']/result)=2]",
         "/response/result/doc[1]/float[@name='id'][.='2.0']",



Mime
View raw message