SOLR-5987: Add "collection" to UpdateParams.

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1587918 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Mark Robert Miller 2014-04-16 14:24:48 +00:00
parent 50e53475ef
commit b0cdbe2242
3 changed files with 7 additions and 4 deletions

View File

@ -113,6 +113,7 @@ Other Changes
* SOLR-5474: Have a new mode for SolrJ to support stateFormat=2 (Noble Paul, Tim Potter) * SOLR-5474: Have a new mode for SolrJ to support stateFormat=2 (Noble Paul, Tim Potter)
* SOLR-5987: Add "collection" to UpdateParams. (Mark Miller, Greg Solovyev)
================== 4.8.0 ================== ================== 4.8.0 ==================

View File

@ -332,7 +332,7 @@ public class CloudSolrServer extends SolrServer {
} }
} }
String collection = nonRoutableParams.get("collection", defaultCollection); String collection = nonRoutableParams.get(UpdateParams.COLLECTION, defaultCollection);
if (collection == null) { if (collection == null) {
throw new SolrServerException("No collection param specified on request and no default collection has been set."); throw new SolrServerException("No collection param specified on request and no default collection has been set.");
} }
@ -721,7 +721,7 @@ public class CloudSolrServer extends SolrServer {
theUrlList.add(zkStateReader.getBaseUrlForNodeName(liveNode)); theUrlList.add(zkStateReader.getBaseUrlForNodeName(liveNode));
} }
} else { } else {
String collection = reqParams.get("collection", defaultCollection); String collection = reqParams.get(UpdateParams.COLLECTION, defaultCollection);
if (collection == null) { if (collection == null) {
throw new SolrServerException( throw new SolrServerException(
@ -771,7 +771,7 @@ public class CloudSolrServer extends SolrServer {
if (nodes.put(node, nodeProps) == null) { if (nodes.put(node, nodeProps) == null) {
if (!sendToLeaders || (sendToLeaders && coreNodeProps.isLeader())) { if (!sendToLeaders || (sendToLeaders && coreNodeProps.isLeader())) {
String url; String url;
if (reqParams.get("collection") == null) { if (reqParams.get(UpdateParams.COLLECTION) == null) {
url = ZkCoreNodeProps.getCoreUrl( url = ZkCoreNodeProps.getCoreUrl(
nodeProps.getStr(ZkStateReader.BASE_URL_PROP), nodeProps.getStr(ZkStateReader.BASE_URL_PROP),
defaultCollection); defaultCollection);
@ -781,7 +781,7 @@ public class CloudSolrServer extends SolrServer {
urlList2.add(url); urlList2.add(url);
} else if (sendToLeaders) { } else if (sendToLeaders) {
String url; String url;
if (reqParams.get("collection") == null) { if (reqParams.get(UpdateParams.COLLECTION) == null) {
url = ZkCoreNodeProps.getCoreUrl( url = ZkCoreNodeProps.getCoreUrl(
nodeProps.getStr(ZkStateReader.BASE_URL_PROP), nodeProps.getStr(ZkStateReader.BASE_URL_PROP),
defaultCollection); defaultCollection);

View File

@ -52,6 +52,8 @@ public interface UpdateParams
/** Rollback update commands */ /** Rollback update commands */
public static String ROLLBACK = "rollback"; public static String ROLLBACK = "rollback";
public static String COLLECTION = "collection";
/** Select the update processor chain to use. A RequestHandler may or may not respect this parameter */ /** Select the update processor chain to use. A RequestHandler may or may not respect this parameter */
public static final String UPDATE_CHAIN = "update.chain"; public static final String UPDATE_CHAIN = "update.chain";