Elasticsearch version: 5.0.0 (master)
JVM version: 1.8
OS version: OSX 10.11.3
Description of the problem including expected versus actual behavior:
While updating the Kibana functional tests to deal with the deprecation of the string mapping type, I tried to create a dynamic template matching text fields with a multi-field mapping as suggested in #12394
My dynamic template looks like this:
"dynamic_templates": [{
"text_fields": {
"mapping": {
"type": "text",
"fields": {
"raw": {
"type": "keyword"
}
}
},
"match_mapping_type": "text",
"match": "*"
}
}]
When posting documents with text fields to this index, the [fieldName].raw field does not get created.
Steps to reproduce:
- Create an index with the above dynamic template.
- Index a document that has a text field.
- Query the field mappings
localhost:9200/<index_name>/_mapping/*/field/*?include_defaults=true
- Notice that the [fieldName].raw field is missing
I tried the same dynamic template with "match_mapping_type": "*" instead of text, and the raw field appeared as expected. I also tried the same multi field mapping on a regular field instead of a template, and that also worked. So this seems to be a problem with the combination of text fields and dynamic templates in particular.
Elasticsearch version: 5.0.0 (master)
JVM version: 1.8
OS version: OSX 10.11.3
Description of the problem including expected versus actual behavior:
While updating the Kibana functional tests to deal with the deprecation of the
stringmapping type, I tried to create a dynamic template matchingtextfields with a multi-field mapping as suggested in #12394My dynamic template looks like this:
When posting documents with text fields to this index, the [fieldName].raw field does not get created.
Steps to reproduce:
localhost:9200/<index_name>/_mapping/*/field/*?include_defaults=trueI tried the same dynamic template with
"match_mapping_type": "*"instead oftext, and the raw field appeared as expected. I also tried the same multi field mapping on a regular field instead of a template, and that also worked. So this seems to be a problem with the combination oftextfields and dynamic templates in particular.