dynamic option is a string, not a boolean

This commit is contained in:
Martijn van Groningen 2016-01-08 11:36:07 +01:00
parent c8aeb11fd6
commit b9dd99636d
2 changed files with 15 additions and 14 deletions

View File

@ -35,6 +35,7 @@ import org.elasticsearch.client.Client;
import org.elasticsearch.cluster.ClusterService;
import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.cluster.metadata.IndexMetaData;
import org.elasticsearch.common.Booleans;
import org.elasticsearch.common.SearchScrollIterator;
import org.elasticsearch.common.bytes.BytesReference;
import org.elasticsearch.common.component.AbstractComponent;
@ -91,12 +92,12 @@ public class PipelineStore extends AbstractComponent implements Closeable {
.startObject("processors")
.field("type", "object")
.field("enabled", false)
.field("dynamic", true)
.field("dynamic", "true")
.endObject()
.startObject("on_failure")
.field("type", "object")
.field("enabled", false)
.field("dynamic", true)
.field("dynamic", "true")
.endObject()
.startObject("description")
.field("type", "string")
@ -359,8 +360,8 @@ public class PipelineStore extends AbstractComponent implements Closeable {
throw new IllegalStateException("illegal ingest mapping, processors field enabled option is [true] while [false] is expected");
}
Boolean processorsDynamic = (Boolean) XContentMapValues.extractValue("properties.processors.dynamic", pipelineMapping);
if (Boolean.TRUE.equals(processorsDynamic) == false) {
String processorsDynamic = (String) XContentMapValues.extractValue("properties.processors.dynamic", pipelineMapping);
if ("true".equals(processorsDynamic) == false) {
throw new IllegalStateException("illegal ingest mapping, processors field dynamic option is [false] while [true] is expected");
}
@ -374,8 +375,8 @@ public class PipelineStore extends AbstractComponent implements Closeable {
throw new IllegalStateException("illegal ingest mapping, on_failure field enabled option is [true] while [false] is expected");
}
Boolean onFailureDynamic = (Boolean) XContentMapValues.extractValue("properties.on_failure.dynamic", pipelineMapping);
if (Boolean.TRUE.equals(onFailureDynamic) == false) {
String onFailureDynamic = (String) XContentMapValues.extractValue("properties.on_failure.dynamic", pipelineMapping);
if ("true".equals(onFailureDynamic) == false) {
throw new IllegalStateException("illegal ingest mapping, on_failure field dynamic option is [false] while [true] is expected");
}
} catch (IOException e) {

View File

@ -271,12 +271,12 @@ public class PipelineStoreTests extends ESTestCase {
.startObject("processors")
.field("type", "object")
.field("enabled", false)
.field("dynamic", true)
.field("dynamic", "true")
.endObject()
.startObject("on_failure")
.field("type", "object")
.field("enabled", false)
.field("dynamic", true)
.field("dynamic", "true")
.endObject()
.startObject("description")
.field("type", "string")
@ -309,12 +309,12 @@ public class PipelineStoreTests extends ESTestCase {
.startObject("processors")
.field("type", "nested")
.field("enabled", false)
.field("dynamic", true)
.field("dynamic", "true")
.endObject()
.startObject("on_failure")
.field("type", "object")
.field("enabled", false)
.field("dynamic", true)
.field("dynamic", "true")
.endObject()
.startObject("description")
.field("type", "string")
@ -347,12 +347,12 @@ public class PipelineStoreTests extends ESTestCase {
.startObject("processors")
.field("type", "object")
.field("enabled", true)
.field("dynamic", true)
.field("dynamic", "true")
.endObject()
.startObject("on_failure")
.field("type", "object")
.field("enabled", false)
.field("dynamic", true)
.field("dynamic", "true")
.endObject()
.startObject("description")
.field("type", "string")
@ -385,12 +385,12 @@ public class PipelineStoreTests extends ESTestCase {
.startObject("processors")
.field("type", "object")
.field("enabled", false)
.field("dynamic", false)
.field("dynamic", "false")
.endObject()
.startObject("on_failure")
.field("type", "object")
.field("enabled", false)
.field("dynamic", true)
.field("dynamic", "true")
.endObject()
.startObject("description")
.field("type", "string")