elasticsearch/server
weizijun e321fb024e
Fix template equals when mappings are wrapped (#77008)
When create template v2. mappings will add _doc. This will cause the created template to be inconsistent with the queried template.

In template class, add mappingsEquals method, to deal with this case.

reproduced:
MetadataIndexTemplateServiceTests.testAddComponentTemplate
when mappings are not null, the case will failed.

```
        Template template = new Template(
            Settings.builder().build(),
            new CompressedXContent("{\"properties\":{\"@timestamp\":{\"type\":\"date\"}}}"),
            ComponentTemplateTests.randomAliases()
        );
        ComponentTemplate componentTemplate = new ComponentTemplate(template, 1L, new HashMap<>());
```

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2021-09-03 14:22:56 -06:00
..
licenses Upgrade to Lucene 8.9.0 (#74729) 2021-06-30 08:49:53 -04:00
src Fix template equals when mappings are wrapped (#77008) 2021-09-03 14:22:56 -06:00
build.gradle Fix spotless gradle config (#76701) 2021-08-19 14:38:21 +01:00