### Elasticsearch Version

8.6.2

### Installed Plugins

mapper-size

### Java Version

_bundled_

### OS Version

3.10.0-1160.83.1.el7.x86_64

### Problem Description

Elastic mapper-size plugin fails on version 8.6.2 with updated templates for global, index, and component (both custom and managed).  It does work in 8.5.0

### Steps to Reproduce

Enable plugin, enable _size field, ingest data
![image](https://user-images.githubusercontent.com/11168913/224350960-498d5abd-62f5-4564-9f62-ac0702c2dd20.png)
![image](https://user-images.githubusercontent.com/11168913/224351072-977a4d34-68cb-448b-9fc3-86f223171de9.png)
![image](https://user-images.githubusercontent.com/11168913/224351165-e5ee1a54-216f-4b20-a571-a09ece65274c.png)
![image](https://user-images.githubusercontent.com/11168913/224351286-13593e3a-d9a2-4b47-ad3c-fa55ea63f4f5.png)

**Works in 8.5.0 though!**
![image](https://user-images.githubusercontent.com/11168913/224351648-5184f1df-0579-4d53-a7a1-97230570a1d5.png)



### Logs (if relevant)

_No response_
plugins/mapper-size/src/internalClusterTest/java/org/elasticsearch/index/mapper/size/SizeMappingIT.java
"Expected size field mapping to be " + (enabled ? "enabled" : "disabled") + " for %s",
            index
        );
        GetMappingsResponse getMappingsResponse = client().admin().indices().prepareGetMappings(index).get();
        Map<String, Object> mappingSource = getMappingsResponse.getMappings().get(index).getSourceAsMap();
        assertThat(errMsg, mappingSource, hasKey("_size"));
        String sizeAsString = mappingSource.get("_size").toString();
        assertThat(sizeAsString, is(notNullValue()));
        assertThat(errMsg, sizeAsString, is("{enabled=" + (enabled) + "}"));
    }
    public void testBasic() throws Exception {
        assertAcked(prepareCreate("test").setMapping("_size", "enabled=true"));
        final String source = "{\"f\":\"" + randomAlphaOfLengthBetween(1, 100) + "\"}";
        indexRandom(true, client().prepareIndex("test").setId("1").setSource(source, XContentType.JSON));
        GetResponse getResponse = client().prepareGet("test", "1").setStoredFields("_size").get();
        assertNotNull(getResponse.getField("_size"));
        assertEquals(source.length(), (int) getResponse.getField("_size").getValue());
    }
    public void testGetWithFields() throws Exception {
        assertAcked(prepareCreate("test").setMapping("_size", "enabled=true"));
        final String source = "{\"f\":\"" + randomAlphaOfLengthBetween(1, 100) + "\"}";
        indexRandom(true, client().prepareIndex("test").setId("1").setSource(source, XContentType.JSON));
        SearchResponse searchResponse = client().prepareSearch("test").addFetchField("_size").get();
        assertEquals(source.length(), ((Long) searchResponse.getHits().getHits()[0].getFields().get("_size").getValue()).intValue());
        
        searchResponse = client().prepareSearch("test").addFetchField("*").get();
        assertNull(searchResponse.getHits().getHits()[0].getFields().get("_size"));
    }
}