Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 561EC200C21 for ; Mon, 16 Jan 2017 01:10:23 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 54E5B160B4F; Mon, 16 Jan 2017 00:10:23 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id B1942160B57 for ; Mon, 16 Jan 2017 01:10:22 +0100 (CET) Received: (qmail 51334 invoked by uid 500); 16 Jan 2017 00:10:20 -0000 Mailing-List: contact commits-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucene.apache.org Delivered-To: mailing list commits@lucene.apache.org Received: (qmail 50798 invoked by uid 99); 16 Jan 2017 00:10:20 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Jan 2017 00:10:20 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id BB317F1736; Mon, 16 Jan 2017 00:10:19 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: hossman@apache.org To: commits@lucene.apache.org Date: Mon, 16 Jan 2017 00:10:28 -0000 Message-Id: <44cdbc3417004e9a82a2cb467cf987b2@git.apache.org> In-Reply-To: <3da430c018ec4e6c9ceb44b42415132c@git.apache.org> References: <3da430c018ec4e6c9ceb44b42415132c@git.apache.org> X-Mailer: ASF-Git Admin Mailer 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 archived-at: Mon, 16 Jan 2017 00:10:23 -0000 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 Authored: Sun Jan 8 06:24:03 2017 -0500 Committer: Mike McCandless 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 collectorManager = - new CollectorManager() { + final CollectorManager collectorManager = + new CollectorManager() { @Override public TopFieldCollector newCollector() throws IOException { @@ -243,16 +244,16 @@ public class DrillSideways { } @Override - public TopDocs reduce(Collection collectors) throws IOException { - final TopDocs[] topDocs = new TopDocs[collectors.size()]; + public TopFieldDocs reduce(Collection 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 r = search(query, collectorManager); + ConcurrentDrillSidewaysResult r = search(query, collectorManager); return new DrillSidewaysResult(r.facets, r.collectorResult); } else {