From 43a95de9db682be97d45da0ef3078a5336fb5606 Mon Sep 17 00:00:00 2001 From: kimchy Date: Tue, 8 Feb 2011 11:38:02 +0200 Subject: [PATCH] dynamic flag on object type should lower case itself when serialized back to its json representation --- .../elasticsearch/index/mapper/xcontent/ObjectMapper.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/index/mapper/xcontent/ObjectMapper.java b/modules/elasticsearch/src/main/java/org/elasticsearch/index/mapper/xcontent/ObjectMapper.java index 731664ddc84..0c33847eca0 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/index/mapper/xcontent/ObjectMapper.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/index/mapper/xcontent/ObjectMapper.java @@ -140,7 +140,7 @@ public class ObjectMapper implements XContentMapper, IncludeInAllMapper { if (fieldName.equals("dynamic")) { String value = fieldNode.toString(); - if (value.equals("strict")) { + if (value.equalsIgnoreCase("strict")) { builder.dynamic(Dynamic.STRICT); } else { builder.dynamic(nodeBooleanValue(fieldNode) ? Dynamic.TRUE : Dynamic.FALSE); @@ -590,11 +590,11 @@ public class ObjectMapper implements XContentMapper, IncludeInAllMapper { // inherit the root behavior if (this instanceof RootObjectMapper) { if (dynamic != Dynamic.TRUE) { - builder.field("dynamic", dynamic); + builder.field("dynamic", dynamic.name().toLowerCase()); } } else { if (dynamic != Defaults.DYNAMIC) { - builder.field("dynamic", dynamic); + builder.field("dynamic", dynamic.name().toLowerCase()); } } if (enabled != Defaults.ENABLED) {