lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hoss...@apache.org
Subject [10/50] [abbrv] lucene-solr:jira/solr-5944: LUCENE-7588: the parallell search method was failing to pass on the user's requested sort when merge-sorting all hits
Date Mon, 16 Jan 2017 00:10:28 GMT
LUCENE-7588: the parallell search method was failing to pass on the user's requested sort when
merge-sorting all hits


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/1aa9c425
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/1aa9c425
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/1aa9c425

Branch: refs/heads/jira/solr-5944
Commit: 1aa9c4251289e71ab8e87b03797b20f4a8fda0a5
Parents: 570880d
Author: Mike McCandless <mikemccand@apache.org>
Authored: Sun Jan 8 06:24:03 2017 -0500
Committer: Mike McCandless <mikemccand@apache.org>
Committed: Sun Jan 8 06:24:03 2017 -0500

----------------------------------------------------------------------
 .../org/apache/lucene/facet/DrillSideways.java  | 37 ++++++++++----------
 1 file changed, 19 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/1aa9c425/lucene/facet/src/java/org/apache/lucene/facet/DrillSideways.java
----------------------------------------------------------------------
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/DrillSideways.java b/lucene/facet/src/java/org/apache/lucene/facet/DrillSideways.java
index 61530bc..b2391f5 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/DrillSideways.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/DrillSideways.java
@@ -16,6 +16,17 @@
  */
 package org.apache.lucene.facet;
 
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Future;
+
 import org.apache.lucene.facet.sortedset.SortedSetDocValuesFacetCounts;
 import org.apache.lucene.facet.sortedset.SortedSetDocValuesFacetField;
 import org.apache.lucene.facet.sortedset.SortedSetDocValuesReaderState;
@@ -34,20 +45,10 @@ import org.apache.lucene.search.ScoreDoc;
 import org.apache.lucene.search.Sort;
 import org.apache.lucene.search.TopDocs;
 import org.apache.lucene.search.TopFieldCollector;
+import org.apache.lucene.search.TopFieldDocs;
 import org.apache.lucene.search.TopScoreDocCollector;
 import org.apache.lucene.util.ThreadInterruptedException;
 
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.Callable;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Future;
-
 /**
  * Computes drill down and sideways counts for the provided
  * {@link DrillDownQuery}.  Drill sideways counts include
@@ -234,8 +235,8 @@ public class DrillSideways {
 
       if (executor != null) { // We have an executor, let use the multi-threaded version
 
-        final CollectorManager<TopFieldCollector, TopDocs> collectorManager =
-                new CollectorManager<TopFieldCollector, TopDocs>() {
+        final CollectorManager<TopFieldCollector, TopFieldDocs> collectorManager =
+                new CollectorManager<TopFieldCollector, TopFieldDocs>() {
 
                   @Override
                   public TopFieldCollector newCollector() throws IOException {
@@ -243,16 +244,16 @@ public class DrillSideways {
                   }
 
                   @Override
-                  public TopDocs reduce(Collection<TopFieldCollector> collectors) throws
IOException {
-                    final TopDocs[] topDocs = new TopDocs[collectors.size()];
+                  public TopFieldDocs reduce(Collection<TopFieldCollector> collectors)
throws IOException {
+                    final TopFieldDocs[] topFieldDocs = new TopFieldDocs[collectors.size()];
                     int pos = 0;
                     for (TopFieldCollector collector : collectors)
-                      topDocs[pos++] = collector.topDocs();
-                    return TopDocs.merge(topN, topDocs);
+                      topFieldDocs[pos++] = collector.topDocs();
+                    return TopDocs.merge(sort, topN, topFieldDocs);
                   }
 
                 };
-        ConcurrentDrillSidewaysResult<TopDocs> r = search(query, collectorManager);
+        ConcurrentDrillSidewaysResult<TopFieldDocs> r = search(query, collectorManager);
         return new DrillSidewaysResult(r.facets, r.collectorResult);
 
       } else {


Mime
View raw message