diff --git a/docs/reference/mapping/types.asciidoc b/docs/reference/mapping/types.asciidoc index 480214f07ece2..adaa47cfb5134 100644 --- a/docs/reference/mapping/types.asciidoc +++ b/docs/reference/mapping/types.asciidoc @@ -44,7 +44,7 @@ string:: <> and <> <>:: Defines an alias to an existing field. -<>:: Allows an entire JSON object to be indexed as a single field. +<>:: Allows an entire JSON object to be indexed as a single field. <>:: Record numeric feature to boost hits at query time. @@ -84,14 +84,14 @@ include::types/date.asciidoc[] include::types/date_nanos.asciidoc[] +include::types/embedded_json.asciidoc[] + include::types/geo-point.asciidoc[] include::types/geo-shape.asciidoc[] include::types/ip.asciidoc[] -include::types/json.asciidoc[] - include::types/keyword.asciidoc[] include::types/nested.asciidoc[] diff --git a/docs/reference/mapping/types/json.asciidoc b/docs/reference/mapping/types/embedded_json.asciidoc similarity index 85% rename from docs/reference/mapping/types/json.asciidoc rename to docs/reference/mapping/types/embedded_json.asciidoc index 724f956e09558..c5d191d6fa585 100644 --- a/docs/reference/mapping/types/json.asciidoc +++ b/docs/reference/mapping/types/embedded_json.asciidoc @@ -1,38 +1,38 @@ -[[json]] -=== JSON datatype +[[embedded-json]] +=== Embedded JSON datatype -experimental[The `json` field type is experimental and may be changed in a breaking way in future releases.] +experimental[The `embedded_json` field type is experimental and may be changed in a breaking way in future releases.] By default, each subfield in an object is mapped and indexed separately. If the names or types of the subfields are not known in advance, then they are <>. -The `json` type provides an alternative approach, where the entire object is -mapped as a single field. Given an object, the `json` mapping will parse out +The `embedded_json` type provides an alternative approach, where the entire object is +mapped as a single field. Given an object, the `embedded_json` mapping will parse out its leaf values and index them into one field. The object's contents can then be searched through simple keyword-style queries. This data type can be useful for indexing objects with a very large number of -distinct keys. Compared to mapping each field separately, `json` fields have +distinct keys. Compared to mapping each field separately, embedded JSON fields have the following advantages: - Only one field mapping is created for the whole object, which can help prevent a <> due to a large number of field mappings. -- A `json` field may take up less space in the index, as only one underlying +- An embedded JSON field may take up less space in the index, as only one underlying field is created. -However, `json` fields present a trade-off in terms of search functionality. +However, embedded JSON fields present a trade-off in terms of search functionality. Only basic queries are allowed, with no support for numeric range queries or highlighting. Further information on the limitations can be found in the <> section. -NOTE: The `json` mapping type should **not** be used for indexing all JSON +NOTE: The `embedded_json` mapping type should **not** be used for indexing all JSON content, as it provides only limited search functionality. The default approach, where each subfield has its own entry in the mappings, works well in the majority of cases. -A `json` field can be created as follows: +An embedded JSON field can be created as follows: [source,js] -------------------------------- PUT bug_reports @@ -43,7 +43,7 @@ PUT bug_reports "type": "text" }, "labels": { - "type": "json" + "type": "embedded_json" } } } @@ -69,7 +69,7 @@ During indexing, tokens are created for each leaf value in the JSON object. The values are indexed as string keywords, without analysis or special handling for numbers or dates. -Querying the top-level `json` field searches all leaf values in the object: +Querying the top-level `embedded_json` field searches all leaf values in the object: [source,js] -------------------------------- POST bug_reports/_search @@ -96,7 +96,7 @@ POST bug_reports/_search [[supported-operations]] ==== Supported operations -Currently, `json` fields can be used with the following query types: +Currently, embedded JSON fields can be used with the following query types: - `term`, `terms`, and `terms_set` - `prefix` @@ -110,7 +110,7 @@ When querying, it is not possible to refer to field keys using wildcards, as in `range`, treat the values as string keywords. Highlighting is not supported on `json` fields. -It is possible to sort on a `json` field, as well as perform simple +It is possible to sort on an embedded JSON field, as well as perform simple keyword-style aggregations such as `terms`. As with queries, there is no special support for numerics -- all values in the JSON object are treated as keywords. When sorting, this implies that values are compared lexicographically. @@ -123,7 +123,7 @@ character `\0` is not allowed to appear in the keys of the JSON object. If the <> option is enabled, the entire JSON object will be stored in pretty-printed format. It can be retrieved through the top-level -`json` field: +`embedded_json` field: [source,js] -------------------------------- @@ -141,7 +141,7 @@ Field keys cannot be used to load stored content. For example, specifying [[json-params]] ==== Parameters for JSON fields -Because of the similarities in the way values are indexed, the `json` type +Because of the similarities in the way values are indexed, the `embedded_json` type shares many mapping options with <>. The following parameters are accepted: diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/search/160_exists_query.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/search/160_exists_query.yml index 9b68451804c2d..e86b057440e35 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/search/160_exists_query.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/search/160_exists_query.yml @@ -1343,7 +1343,7 @@ setup: dynamic: false properties: json: - type: json + type: embedded_json - do: index: index: json_test diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/search/60_query_string.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/search/60_query_string.yml index 83baecf4c9c63..f74a504556943 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/search/60_query_string.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/search/60_query_string.yml @@ -75,7 +75,7 @@ mappings: properties: headers: - type: json + type: embedded_json - do: index: diff --git a/server/src/main/java/org/elasticsearch/index/mapper/JsonFieldMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/JsonFieldMapper.java index 24a01a444d49c..cfb15b1a02c80 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/JsonFieldMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/JsonFieldMapper.java @@ -98,7 +98,7 @@ */ public final class JsonFieldMapper extends FieldMapper { - public static final String CONTENT_TYPE = "json"; + public static final String CONTENT_TYPE = "embedded_json"; public static final NamedAnalyzer WHITESPACE_ANALYZER = new NamedAnalyzer( "whitespace", AnalyzerScope.INDEX, new WhitespaceAnalyzer()); private static final String KEYED_FIELD_SUFFIX = "._keyed"; diff --git a/server/src/main/java/org/elasticsearch/index/mapper/JsonFieldParser.java b/server/src/main/java/org/elasticsearch/index/mapper/JsonFieldParser.java index 9c85323e09a5c..becf1b4b36602 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/JsonFieldParser.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/JsonFieldParser.java @@ -139,7 +139,7 @@ private void addField(ContentPath path, String key = path.pathAsText(currentName); if (key.contains(SEPARATOR)) { - throw new IllegalArgumentException("Keys in [json] fields cannot contain the reserved character \\0." + throw new IllegalArgumentException("Keys in [embedded_json] fields cannot contain the reserved character \\0." + " Offending key: [" + key + "]."); } String keyedValue = createKeyedValue(key, value); diff --git a/server/src/test/java/org/elasticsearch/index/mapper/JsonFieldMapperTests.java b/server/src/test/java/org/elasticsearch/index/mapper/JsonFieldMapperTests.java index 3aa3890fb312a..6936fa608b3bf 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/JsonFieldMapperTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/JsonFieldMapperTests.java @@ -64,7 +64,7 @@ public void testDefaults() throws Exception { .startObject("type") .startObject("properties") .startObject("field") - .field("type", "json") + .field("type", "embedded_json") .endObject() .endObject() .endObject() @@ -119,7 +119,7 @@ public void testDisableIndex() throws Exception { .startObject("type") .startObject("properties") .startObject("field") - .field("type", "json") + .field("type", "embedded_json") .field("index", false) .endObject() .endObject() @@ -151,7 +151,7 @@ public void testDisableDocValues() throws Exception { .startObject("type") .startObject("properties") .startObject("field") - .field("type", "json") + .field("type", "embedded_json") .field("doc_values", false) .endObject() .endObject() @@ -187,11 +187,11 @@ public void testEnableStore() throws Exception { .startObject("type") .startObject("properties") .startObject("store") - .field("type", "json") + .field("type", "embedded_json") .field("store", true) .endObject() .startObject("store_only") - .field("type", "json") + .field("type", "embedded_json") .field("index", false) .field("store", true) .field("doc_values", false) @@ -241,7 +241,7 @@ public void testIndexOptions() throws IOException { .startObject("type") .startObject("properties") .startObject("field") - .field("type", "json") + .field("type", "embedded_json") .field("index_options", "freqs") .endObject() .endObject() @@ -256,7 +256,7 @@ public void testIndexOptions() throws IOException { .startObject("type") .startObject("properties") .startObject("field") - .field("type", "json") + .field("type", "embedded_json") .field("index_options", indexOptions) .endObject() .endObject() @@ -264,7 +264,7 @@ public void testIndexOptions() throws IOException { .endObject()); IllegalArgumentException e = expectThrows(IllegalArgumentException.class, () -> parser.parse("type", new CompressedXContent(invalidMapping))); - assertEquals("The [json] field does not support positions, got [index_options]=" + indexOptions, e.getMessage()); + assertEquals("The [embedded_json] field does not support positions, got [index_options]=" + indexOptions, e.getMessage()); } } @@ -273,7 +273,7 @@ public void testNullField() throws Exception { .startObject("type") .startObject("properties") .startObject("field") - .field("type", "json") + .field("type", "embedded_json") .endObject() .endObject() .endObject() @@ -296,7 +296,7 @@ public void testMalformedJson() throws Exception { .startObject("type") .startObject("properties") .startObject("field") - .field("type", "json") + .field("type", "embedded_json") .endObject() .endObject() .endObject() @@ -322,7 +322,7 @@ public void testFieldMultiplicity() throws Exception { .startObject("type") .startObject("properties") .startObject("field") - .field("type", "json") + .field("type", "embedded_json") .endObject() .endObject() .endObject() @@ -363,7 +363,7 @@ public void testDepthLimit() throws IOException { .startObject("type") .startObject("properties") .startObject("field") - .field("type", "json") + .field("type", "embedded_json") .field("depth_limit", 2) .endObject() .endObject() @@ -392,7 +392,7 @@ public void testEagerGlobalOrdinals() throws IOException { .startObject("type") .startObject("properties") .startObject("field") - .field("type", "json") + .field("type", "embedded_json") .field("eager_global_ordinals", true) .endObject().endObject() .endObject().endObject()); @@ -409,7 +409,7 @@ public void testIgnoreAbove() throws IOException { .startObject("type") .startObject("properties") .startObject("field") - .field("type", "json") + .field("type", "embedded_json") .field("ignore_above", 10) .endObject() .endObject() @@ -437,10 +437,10 @@ public void testNullValues() throws Exception { .startObject("type") .startObject("properties") .startObject("field") - .field("type", "json") + .field("type", "embedded_json") .endObject() .startObject("other_field") - .field("type", "json") + .field("type", "embedded_json") .field("null_value", "placeholder") .endObject() .endObject() @@ -480,7 +480,7 @@ public void testSplitQueriesOnWhitespace() throws IOException { .startObject("type") .startObject("properties") .startObject("field") - .field("type", "json") + .field("type", "embedded_json") .field("split_queries_on_whitespace", true) .endObject() .endObject() diff --git a/server/src/test/java/org/elasticsearch/index/mapper/JsonFieldParserTests.java b/server/src/test/java/org/elasticsearch/index/mapper/JsonFieldParserTests.java index eeedfb890fd43..266582ce92854 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/JsonFieldParserTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/JsonFieldParserTests.java @@ -318,7 +318,7 @@ public void testReservedCharacters() throws Exception { XContentParser xContentParser = createXContentParser(input.utf8ToString()); IllegalArgumentException e = expectThrows(IllegalArgumentException.class, () -> parser.parse(xContentParser)); - assertEquals("Keys in [json] fields cannot contain the reserved character \\0. Offending key: [k\0y].", + assertEquals("Keys in [embedded_json] fields cannot contain the reserved character \\0. Offending key: [k\0y].", e.getMessage()); } diff --git a/server/src/test/java/org/elasticsearch/index/mapper/KeyedJsonFieldTypeTests.java b/server/src/test/java/org/elasticsearch/index/mapper/KeyedJsonFieldTypeTests.java index 2063556b9fbda..5c045cf32fe4c 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/KeyedJsonFieldTypeTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/KeyedJsonFieldTypeTests.java @@ -117,7 +117,7 @@ public void testFuzzyQuery() { UnsupportedOperationException e = expectThrows(UnsupportedOperationException.class, () -> ft.fuzzyQuery("valuee", Fuzziness.fromEdits(2), 1, 50, true)); - assertEquals("[fuzzy] queries are not currently supported on [json] fields.", e.getMessage()); + assertEquals("[fuzzy] queries are not currently supported on [embedded_json] fields.", e.getMessage()); } public void testRangeQuery() { @@ -136,12 +136,12 @@ public void testRangeQuery() { IllegalArgumentException e = expectThrows(IllegalArgumentException.class, () -> ft.rangeQuery("lower", null, false, false, null)); - assertEquals("[range] queries on keyed [json] fields must include both an upper and a lower bound.", + assertEquals("[range] queries on keyed [embedded_json] fields must include both an upper and a lower bound.", e.getMessage()); e = expectThrows(IllegalArgumentException.class, () -> ft.rangeQuery(null, "upper", false, false, null)); - assertEquals("[range] queries on keyed [json] fields must include both an upper and a lower bound.", + assertEquals("[range] queries on keyed [embedded_json] fields must include both an upper and a lower bound.", e.getMessage()); } @@ -151,7 +151,7 @@ public void testRegexpQuery() { UnsupportedOperationException e = expectThrows(UnsupportedOperationException.class, () -> ft.regexpQuery("valu*", 0, 10, null, null)); - assertEquals("[regexp] queries are not currently supported on [json] fields.", e.getMessage()); + assertEquals("[regexp] queries are not currently supported on [embedded_json] fields.", e.getMessage()); } public void testWildcardQuery() { @@ -160,6 +160,6 @@ public void testWildcardQuery() { UnsupportedOperationException e = expectThrows(UnsupportedOperationException.class, () -> ft.wildcardQuery("valu*", null, null)); - assertEquals("[wildcard] queries are not currently supported on [json] fields.", e.getMessage()); + assertEquals("[wildcard] queries are not currently supported on [embedded_json] fields.", e.getMessage()); } } diff --git a/server/src/test/java/org/elasticsearch/index/mapper/RootJsonFieldTypeTests.java b/server/src/test/java/org/elasticsearch/index/mapper/RootJsonFieldTypeTests.java index 6f7294b0461c4..5bbd8cda68529 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/RootJsonFieldTypeTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/RootJsonFieldTypeTests.java @@ -85,7 +85,7 @@ public void testFuzzyQuery() { UnsupportedOperationException e = expectThrows(UnsupportedOperationException.class, () -> ft.fuzzyQuery("valuee", Fuzziness.fromEdits(2), 1, 50, true)); - assertEquals("[fuzzy] queries are not currently supported on [json] fields.", e.getMessage()); + assertEquals("[fuzzy] queries are not currently supported on [embedded_json] fields.", e.getMessage()); } public void testRangeQuery() { @@ -109,7 +109,7 @@ public void testRegexpQuery() { UnsupportedOperationException e = expectThrows(UnsupportedOperationException.class, () -> ft.regexpQuery("valu*", 0, 10, null, null)); - assertEquals("[regexp] queries are not currently supported on [json] fields.", e.getMessage()); + assertEquals("[regexp] queries are not currently supported on [embedded_json] fields.", e.getMessage()); } public void testWildcardQuery() { @@ -118,6 +118,6 @@ public void testWildcardQuery() { UnsupportedOperationException e = expectThrows(UnsupportedOperationException.class, () -> ft.wildcardQuery("valu*", null, null)); - assertEquals("[wildcard] queries are not currently supported on [json] fields.", e.getMessage()); + assertEquals("[wildcard] queries are not currently supported on [embedded_json] fields.", e.getMessage()); } } diff --git a/server/src/test/java/org/elasticsearch/index/search/MultiMatchQueryTests.java b/server/src/test/java/org/elasticsearch/index/search/MultiMatchQueryTests.java index 01b0ee5788bbb..bcc01c9dde837 100644 --- a/server/src/test/java/org/elasticsearch/index/search/MultiMatchQueryTests.java +++ b/server/src/test/java/org/elasticsearch/index/search/MultiMatchQueryTests.java @@ -343,10 +343,10 @@ public void testJsonSplitQueriesOnWhitespace() throws IOException { .startObject("type") .startObject("properties") .startObject("field") - .field("type", "json") + .field("type", "embedded_json") .endObject() .startObject("field_split") - .field("type", "json") + .field("type", "embedded_json") .field("split_queries_on_whitespace", true) .endObject() .endObject() diff --git a/server/src/test/java/org/elasticsearch/search/aggregations/bucket/terms/StringTermsIT.java b/server/src/test/java/org/elasticsearch/search/aggregations/bucket/terms/StringTermsIT.java index ae241f3a04bb2..475f3cb127a07 100644 --- a/server/src/test/java/org/elasticsearch/search/aggregations/bucket/terms/StringTermsIT.java +++ b/server/src/test/java/org/elasticsearch/search/aggregations/bucket/terms/StringTermsIT.java @@ -128,7 +128,7 @@ public void setupSuiteScopeCluster() throws Exception { .addMapping("type", SINGLE_VALUED_FIELD_NAME, "type=keyword", MULTI_VALUED_FIELD_NAME, "type=keyword", "tag", "type=keyword", - JSON_FIELD_NAME, "type=json").get()); + JSON_FIELD_NAME, "type=embedded_json").get()); List builders = new ArrayList<>(); for (int i = 0; i < 5; i++) { builders.add(client().prepareIndex("idx", "type").setSource( diff --git a/server/src/test/java/org/elasticsearch/search/fields/SearchFieldsIT.java b/server/src/test/java/org/elasticsearch/search/fields/SearchFieldsIT.java index cd1dea55b648b..a4f3ef595cdcb 100644 --- a/server/src/test/java/org/elasticsearch/search/fields/SearchFieldsIT.java +++ b/server/src/test/java/org/elasticsearch/search/fields/SearchFieldsIT.java @@ -1233,7 +1233,7 @@ public void testJsonStoredFields() throws Exception { .startObject("_doc") .startObject("properties") .startObject("json_field") - .field("type", "json") + .field("type", "embedded_json") .field("store", true) .endObject() .endObject() @@ -1278,7 +1278,7 @@ public void testJsonDocValuesFields() throws Exception { .startObject("_doc") .startObject("properties") .startObject("json_field") - .field("type", "json") + .field("type", "embedded_json") .endObject() .endObject() .endObject() diff --git a/server/src/test/java/org/elasticsearch/search/query/ExistsIT.java b/server/src/test/java/org/elasticsearch/search/query/ExistsIT.java index 69936b940f5c8..edee8f0e6c149 100644 --- a/server/src/test/java/org/elasticsearch/search/query/ExistsIT.java +++ b/server/src/test/java/org/elasticsearch/search/query/ExistsIT.java @@ -238,7 +238,7 @@ public void testJsonFields() throws Exception { .startObject("type") .startObject("properties") .startObject("headers") - .field("type", "json") + .field("type", "embedded_json") .endObject() .endObject() .endObject() diff --git a/server/src/test/java/org/elasticsearch/search/query/MatchQueryIT.java b/server/src/test/java/org/elasticsearch/search/query/MatchQueryIT.java index 7f594d21545d3..5531059fcfd56 100644 --- a/server/src/test/java/org/elasticsearch/search/query/MatchQueryIT.java +++ b/server/src/test/java/org/elasticsearch/search/query/MatchQueryIT.java @@ -35,7 +35,7 @@ public void testJsonFields() throws Exception { .startObject("_doc") .startObject("properties") .startObject("headers") - .field("type", "json") + .field("type", "embedded_json") .field("split_queries_on_whitespace", true) .endObject() .endObject() diff --git a/server/src/test/java/org/elasticsearch/search/query/MultiMatchQueryIT.java b/server/src/test/java/org/elasticsearch/search/query/MultiMatchQueryIT.java index ba058ab93a25f..0550cd9c62891 100644 --- a/server/src/test/java/org/elasticsearch/search/query/MultiMatchQueryIT.java +++ b/server/src/test/java/org/elasticsearch/search/query/MultiMatchQueryIT.java @@ -717,7 +717,7 @@ public void testJsonFields() throws Exception { .startObject("_doc") .startObject("properties") .startObject("headers") - .field("type", "json") + .field("type", "embedded_json") .field("split_queries_on_whitespace", true) .endObject() .endObject() diff --git a/server/src/test/java/org/elasticsearch/search/sort/FieldSortIT.java b/server/src/test/java/org/elasticsearch/search/sort/FieldSortIT.java index 42ab2de53a6a4..acc51947e59a3 100644 --- a/server/src/test/java/org/elasticsearch/search/sort/FieldSortIT.java +++ b/server/src/test/java/org/elasticsearch/search/sort/FieldSortIT.java @@ -1792,7 +1792,7 @@ public void testJsonField() throws Exception { .startObject("_doc") .startObject("properties") .startObject("json_field") - .field("type", "json") + .field("type", "embedded_json") .endObject() .endObject() .endObject() diff --git a/server/src/test/java/org/elasticsearch/search/source/SourceFetchingIT.java b/server/src/test/java/org/elasticsearch/search/source/SourceFetchingIT.java index e7bec8bc1dd18..957001f918a5b 100644 --- a/server/src/test/java/org/elasticsearch/search/source/SourceFetchingIT.java +++ b/server/src/test/java/org/elasticsearch/search/source/SourceFetchingIT.java @@ -101,7 +101,7 @@ public void testSourceWithWildcardFiltering() { } public void testSourceFilteringWithJsonField() { - prepareCreate("test").addMapping("_doc", "headers", "type=json").get(); + prepareCreate("test").addMapping("_doc", "headers", "type=embedded_json").get(); ensureGreen(); Map headers = new HashMap<>(); diff --git a/server/src/test/resources/org/elasticsearch/search/query/all-query-index.json b/server/src/test/resources/org/elasticsearch/search/query/all-query-index.json index 208c88f2817b2..bef3f28908255 100644 --- a/server/src/test/resources/org/elasticsearch/search/query/all-query-index.json +++ b/server/src/test/resources/org/elasticsearch/search/query/all-query-index.json @@ -61,7 +61,7 @@ "path": "f_geop" }, "f_geos": {"type": "geo_shape"}, - "f_json": {"type": "json"} + "f_json": {"type": "embedded_json"} } } } diff --git a/test/framework/src/main/java/org/elasticsearch/test/AbstractBuilderTestCase.java b/test/framework/src/main/java/org/elasticsearch/test/AbstractBuilderTestCase.java index bb9f8293c9c10..a108a1332b9e8 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/AbstractBuilderTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/test/AbstractBuilderTestCase.java @@ -400,7 +400,7 @@ public void onRemoval(ShardId shardId, Accountable accountable) { GEO_POINT_FIELD_NAME, "type=geo_point", GEO_POINT_ALIAS_FIELD_NAME, "type=alias,path=" + GEO_POINT_FIELD_NAME, GEO_SHAPE_FIELD_NAME, "type=geo_shape", - JSON_FIELD_NAME, "type=json" + JSON_FIELD_NAME, "type=embedded_json" ))), MapperService.MergeReason.MAPPING_UPDATE); // also add mappings for two inner field in the object field mapperService.merge("_doc", new CompressedXContent("{\"properties\":{\"" + OBJECT_FIELD_NAME + "\":{\"type\":\"object\","