lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cpoersc...@apache.org
Subject svn commit: r1706313 - in /lucene/dev/trunk/solr: CHANGES.txt core/src/java/org/apache/solr/handler/component/QueryComponent.java core/src/java/org/apache/solr/search/grouping/distributed/requestfactory/TopGroupsShardRequestFactory.java
Date Thu, 01 Oct 2015 19:56:45 GMT
Author: cpoerschke
Date: Thu Oct  1 19:56:45 2015
New Revision: 1706313

URL: http://svn.apache.org/viewvc?rev=1706313&view=rev
Log:
SOLR-8025: remove unnecessary ResponseBuilder.getQueryCommand() calls

Modified:
    lucene/dev/trunk/solr/CHANGES.txt
    lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java
    lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/grouping/distributed/requestfactory/TopGroupsShardRequestFactory.java

Modified: lucene/dev/trunk/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/CHANGES.txt?rev=1706313&r1=1706312&r2=1706313&view=diff
==============================================================================
--- lucene/dev/trunk/solr/CHANGES.txt (original)
+++ lucene/dev/trunk/solr/CHANGES.txt Thu Oct  1 19:56:45 2015
@@ -294,6 +294,8 @@ Other Changes
 
 * SOLR-8083: Convert the ZookeeperInfoServlet to a handler at /admin/zookeeper (noble)
 
+* SOLR-8025: remove unnecessary ResponseBuilder.getQueryCommand() calls (Christine Poerschke)
+
 ==================  5.3.1 ==================
 
 Bug Fixes

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java?rev=1706313&r1=1706312&r2=1706313&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java
(original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java
Thu Oct  1 19:56:45 2015
@@ -225,7 +225,7 @@ public class QueryComponent extends Sear
     }
 
     //Input validation.
-    if (rb.getQueryCommand().getOffset() < 0) {
+    if (rb.getSortSpec().getOffset() < 0) {
       throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, "'start' parameter cannot
be negative");
     }
   }
@@ -242,13 +242,14 @@ public class QueryComponent extends Sear
                               CursorMarkParams.CURSOR_MARK_PARAM);
     }
 
-    SolrIndexSearcher.QueryCommand cmd = rb.getQueryCommand();
     SolrIndexSearcher searcher = rb.req.getSearcher();
     GroupingSpecification groupingSpec = new GroupingSpecification();
     rb.setGroupingSpec(groupingSpec);
 
+    final SortSpec sortSpec = rb.getSortSpec();
+
     //TODO: move weighting of sort
-    Sort groupSort = searcher.weightSort(cmd.getSort());
+    Sort groupSort = searcher.weightSort(sortSpec.getSort());
     if (groupSort == null) {
       groupSort = Sort.RELEVANCE;
     }
@@ -278,11 +279,11 @@ public class QueryComponent extends Sear
     groupingSpec.setFunctions(params.getParams(GroupParams.GROUP_FUNC));
     groupingSpec.setGroupOffset(params.getInt(GroupParams.GROUP_OFFSET, 0));
     groupingSpec.setGroupLimit(params.getInt(GroupParams.GROUP_LIMIT, 1));
-    groupingSpec.setOffset(rb.getSortSpec().getOffset());
-    groupingSpec.setLimit(rb.getSortSpec().getCount());
+    groupingSpec.setOffset(sortSpec.getOffset());
+    groupingSpec.setLimit(sortSpec.getCount());
     groupingSpec.setIncludeGroupCount(params.getBool(GroupParams.GROUP_TOTAL_COUNT, false));
     groupingSpec.setMain(params.getBool(GroupParams.GROUP_MAIN, false));
-    groupingSpec.setNeedScore((cmd.getFlags() & SolrIndexSearcher.GET_SCORES) != 0);
+    groupingSpec.setNeedScore((rb.getFieldFlags() & SolrIndexSearcher.GET_SCORES) !=
0);
     groupingSpec.setTruncateGroups(params.getBool(GroupParams.GROUP_TRUNCATE, false));
   }
 

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/grouping/distributed/requestfactory/TopGroupsShardRequestFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/grouping/distributed/requestfactory/TopGroupsShardRequestFactory.java?rev=1706313&r1=1706312&r2=1706313&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/grouping/distributed/requestfactory/TopGroupsShardRequestFactory.java
(original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/grouping/distributed/requestfactory/TopGroupsShardRequestFactory.java
Thu Oct  1 19:56:45 2015
@@ -56,7 +56,7 @@ public class TopGroupsShardRequestFactor
     // If we have a group.query we need to query all shards... Or we move this to the group
first phase queries
     boolean containsGroupByQuery = rb.getGroupingSpec().getQueries().length > 0;
     // TODO: If groups.truncate=true we only have to query the specific shards even faceting
and statistics are enabled
-    if ((rb.getQueryCommand().getFlags() & SolrIndexSearcher.GET_DOCSET) != 0 || containsGroupByQuery)
{
+    if (rb.isNeedDocSet() || containsGroupByQuery) {
       // In case we need more results such as faceting and statistics we have to query all
shards
       return createRequestForAllShards(rb);
     } else {



Mime
View raw message