We are using mapper attachment plugin with ES 2.4.4.
When we are indexing documents for one doc type things are working fine. But when attachment field comes in second doc type, we get mapping conflict error for file.content field.
Following is error
reason=Mapper for [file.content] conflicts with existing mapping in other types:
[mapper [file.content] has different [store] values, mapper [file.content] has different [store_term_vector] values, mapper [file.content] has different [store_term_vector_offsets] values, mapper [file.content] has different [store_term_vector_positions] values]
Following is the dynamic mapping we are using
{
"template": "test-documents*",
"settings": {
"number_of_shards": 5,
"number_of_replicas": 0
},
"mappings": {
"_default_": {
"dynamic_templates": [
{
"template_1": {
"match": "file",
"match_mapping_type": "string",
"mapping": {
"type": "attachment",
"fields": {
"content_length": {
"type": "integer",
"store": true
},
"content_type": {
"type": "string",
"store": true
},
"date": {
"type": "date",
"store": true
},
"name": {
"type": "string",
"store": true
},
"author": {
"type": "string",
"store": true
},
"title": {
"type": "string",
"store": true
},
"keywords": {
"type": "string",
"store": true
},
"language": {
"type": "string",
"store": true
},
"content": {
"type": "string",
"term_vector": "with_positions_offsets",
"store": true
}
}
}
}
},
{
"string_template": {
"path_match": "*",
"mapping": {
"type": "multi_field",
"fields": {
"{name}": {
"name": "{name}",
"index": "analyzed",
"store": false,
"type": "{dynamic_type}"
},
"raw": {
"name": "raw",
"index": "not_analyzed",
"store": true,
"type": "{dynamic_type}",
"ignore_above": "1024"
}
}
},
"match_mapping_type": "string"
}
}
],
"properties": {}
}
}
}