diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/index/mapper/json/JsonBooleanFieldMapper.java b/modules/elasticsearch/src/main/java/org/elasticsearch/index/mapper/json/JsonBooleanFieldMapper.java index 007aaf03583..dbccfdc5034 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/index/mapper/json/JsonBooleanFieldMapper.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/index/mapper/json/JsonBooleanFieldMapper.java @@ -124,6 +124,18 @@ public class JsonBooleanFieldMapper extends JsonFieldMapper { if (nullValue != null) { value = nullValue ? "T" : "F"; } + } else if (token == JsonToken.VALUE_NUMBER_INT) { + if (jsonContext.jp().getIntValue() == 0) { + value = "F"; + } else { + value = "T"; + } + } else if (token == JsonToken.VALUE_STRING) { + if (jsonContext.jp().getText().equals("false")) { + value = "F"; + } else { + value = "T"; + } } else { return null; }