SOLR-5353: Allow CoreAdmin split to accept a single range only

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1533528 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Shalin Shekhar Mangar 2013-10-18 16:11:01 +00:00
parent e6f237d4c3
commit a4cb46ce23
1 changed files with 2 additions and 2 deletions

View File

@ -236,8 +236,8 @@ public class CoreAdminHandler extends RequestHandlerBase {
String rangesStr = params.get(CoreAdminParams.RANGES); // ranges=a-b,c-d,e-f
if (rangesStr != null) {
String[] rangesArr = rangesStr.split(",");
if (rangesArr.length == 0 || rangesArr.length == 1) {
throw new SolrException(ErrorCode.BAD_REQUEST, "There must be at least two ranges specified to split an index");
if (rangesArr.length == 0) {
throw new SolrException(ErrorCode.BAD_REQUEST, "There must be at least one range specified to split an index");
} else {
ranges = new ArrayList<DocRouter.Range>(rangesArr.length);
for (String r : rangesArr) {