You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by mv...@apache.org on 2012/03/21 00:21:56 UTC
svn commit: r1303203 - in /lucene/dev/branches/branch_3x/solr:
core/src/java/org/apache/solr/handler/component/
core/src/java/org/apache/solr/search/grouping/distributed/requestfactory/
solrj/src/java/org/apache/solr/common/params/
Author: mvg
Date: Tue Mar 20 23:21:55 2012
New Revision: 1303203
URL: http://svn.apache.org/viewvc?rev=1303203&view=rev
Log:
SOLR-3052: Added jdocs
Modified:
lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java
lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/search/grouping/distributed/requestfactory/SearchGroupsRequestFactory.java
lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/search/grouping/distributed/requestfactory/TopGroupsShardRequestFactory.java
lucene/dev/branches/branch_3x/solr/solrj/src/java/org/apache/solr/common/params/GroupParams.java
Modified: lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java?rev=1303203&r1=1303202&r2=1303203&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java (original)
+++ lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java Tue Mar 20 23:21:55 2012
@@ -251,7 +251,7 @@ public class QueryComponent extends Sear
if (groupingSpec != null) {
try {
boolean needScores = (cmd.getFlags() & SolrIndexSearcher.GET_SCORES) != 0;
- if (params.getBool("group.distributed.first", false)) {
+ if (params.getBool(GroupParams.GROUP_DISTRIBUTED_FIRST, false)) {
CommandHandler.Builder topsGroupsActionBuilder = new CommandHandler.Builder()
.setQueryCommand(cmd)
.setNeedDocSet(false) // Order matters here
@@ -272,14 +272,14 @@ public class QueryComponent extends Sear
rsp.add("firstPhase", commandHandler.processResult(result, serializer));
rb.setResult(result);
return;
- } else if (params.getBool("group.distributed.second", false)) {
+ } else if (params.getBool(GroupParams.GROUP_DISTRIBUTED_SECOND, false)) {
CommandHandler.Builder secondPhaseBuilder = new CommandHandler.Builder()
.setQueryCommand(cmd)
.setTruncateGroups(groupingSpec.isTruncateGroups() && groupingSpec.getFields().length > 0)
.setSearcher(searcher);
for (String field : groupingSpec.getFields()) {
- String[] topGroupsParam = params.getParams("group.topgroups." + field);
+ String[] topGroupsParam = params.getParams(GroupParams.GROUP_DISTRIBUTED_TOPGROUPS_PREFIX + field);
if (topGroupsParam == null) {
continue;
}
Modified: lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/search/grouping/distributed/requestfactory/SearchGroupsRequestFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/search/grouping/distributed/requestfactory/SearchGroupsRequestFactory.java?rev=1303203&r1=1303202&r2=1303203&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/search/grouping/distributed/requestfactory/SearchGroupsRequestFactory.java (original)
+++ lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/search/grouping/distributed/requestfactory/SearchGroupsRequestFactory.java Tue Mar 20 23:21:55 2012
@@ -18,6 +18,7 @@ package org.apache.solr.search.grouping.
*/
import org.apache.solr.common.params.CommonParams;
+import org.apache.solr.common.params.GroupParams;
import org.apache.solr.common.params.ModifiableSolrParams;
import org.apache.solr.common.params.ShardParams;
import org.apache.solr.handler.component.ResponseBuilder;
@@ -71,7 +72,7 @@ public class SearchGroupsRequestFactory
// in this first phase, request only the unique key field
// and any fields needed for merging.
- sreq.params.set("group.distributed.first","true");
+ sreq.params.set(GroupParams.GROUP_DISTRIBUTED_FIRST,"true");
if ( (rb.getFieldFlags() & SolrIndexSearcher.GET_SCORES)!=0 || rb.getSortSpec().includesScore()) {
sreq.params.set(CommonParams.FL, rb.req.getSchema().getUniqueKeyField().getName() + ",score");
Modified: lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/search/grouping/distributed/requestfactory/TopGroupsShardRequestFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/search/grouping/distributed/requestfactory/TopGroupsShardRequestFactory.java?rev=1303203&r1=1303202&r2=1303203&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/search/grouping/distributed/requestfactory/TopGroupsShardRequestFactory.java (original)
+++ lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/search/grouping/distributed/requestfactory/TopGroupsShardRequestFactory.java Tue Mar 20 23:21:55 2012
@@ -110,7 +110,7 @@ public class TopGroupsShardRequestFactor
sreq.params.set(CommonParams.ROWS, rb.getSortSpec().getOffset() + rb.getSortSpec().getCount());
}
- sreq.params.set("group.distributed.second", "true");
+ sreq.params.set(GroupParams.GROUP_DISTRIBUTED_SECOND, "true");
for (Map.Entry<String, Collection<SearchGroup<String>>> entry : rb.mergedSearchGroups.entrySet()) {
for (SearchGroup<String> searchGroup : entry.getValue()) {
String groupValue;
@@ -121,7 +121,7 @@ public class TopGroupsShardRequestFactor
} else {
groupValue = GROUP_NULL_VALUE;
}
- sreq.params.add("group.topgroups." + entry.getKey(), groupValue);
+ sreq.params.add(GroupParams.GROUP_DISTRIBUTED_TOPGROUPS_PREFIX + entry.getKey(), groupValue);
}
}
Modified: lucene/dev/branches/branch_3x/solr/solrj/src/java/org/apache/solr/common/params/GroupParams.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/solr/solrj/src/java/org/apache/solr/common/params/GroupParams.java?rev=1303203&r1=1303202&r2=1303203&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/solr/solrj/src/java/org/apache/solr/common/params/GroupParams.java (original)
+++ lucene/dev/branches/branch_3x/solr/solrj/src/java/org/apache/solr/common/params/GroupParams.java Tue Mar 20 23:21:55 2012
@@ -55,4 +55,14 @@ public interface GroupParams {
/** Whether the group count should be included in the response. */
public static final String GROUP_TOTAL_COUNT = GROUP + ".ngroups";
+ /** Retrieve the top search groups (top group values) from the shards being queried. */
+ public static final String GROUP_DISTRIBUTED_FIRST = GROUP + ".distributed.first";
+
+ /** Retrieve the top groups from the shards being queries based on the specified search groups in
+ * the {@link #GROUP_DISTRIBUTED_TOPGROUPS_PREFIX} parameters.
+ */
+ public static final String GROUP_DISTRIBUTED_SECOND = GROUP + ".distributed.second";
+
+ public static final String GROUP_DISTRIBUTED_TOPGROUPS_PREFIX = GROUP + ".topgroups.";
+
}