diff --git a/server/src/main/java/org/elasticsearch/index/reindex/ReindexRequest.java b/server/src/main/java/org/elasticsearch/index/reindex/ReindexRequest.java index 65d1c3d73d3..bb7bbf277a3 100644 --- a/server/src/main/java/org/elasticsearch/index/reindex/ReindexRequest.java +++ b/server/src/main/java/org/elasticsearch/index/reindex/ReindexRequest.java @@ -406,7 +406,7 @@ public class ReindexRequest extends AbstractBulkIndexByScrollRequest source, String name) { Object value = source.remove(name); @@ -418,9 +418,9 @@ public class ReindexRequest extends AbstractBulkIndexByScrollRequest list = (List) value; return list.toArray(new String[list.size()]); } else if (value instanceof String) { - return new String[] {(String) value}; + return Strings.splitStringByCommaToArray((String) value); } else { - throw new IllegalArgumentException("Expected [" + name + "] to be a list of a string but was [" + value + ']'); + throw new IllegalArgumentException("Expected [" + name + "] to be a list or a string but was [" + value + ']'); } } diff --git a/server/src/test/java/org/elasticsearch/index/reindex/ReindexRequestTests.java b/server/src/test/java/org/elasticsearch/index/reindex/ReindexRequestTests.java index db7fdb097d8..b5ca4efcc4f 100644 --- a/server/src/test/java/org/elasticsearch/index/reindex/ReindexRequestTests.java +++ b/server/src/test/java/org/elasticsearch/index/reindex/ReindexRequestTests.java @@ -324,4 +324,44 @@ public class ReindexRequestTests extends AbstractBulkByScrollRequestTestCase