# Mapper attachment plugin on ES 2.4.4 not working. Giving mapping conflict error for file.content

**URL:** <https://discuss.elastic.co/t/mapper-attachment-plugin-on-es-2-4-4-not-working-giving-mapping-conflict-error-for-file-content/81134>\
**Category:** Elasticsearch\
**Created:** [April 4, 2017, 11:34am UTC](https://discuss.elastic.co/t/mapper-attachment-plugin-on-es-2-4-4-not-working-giving-mapping-conflict-error-for-file-content/81134 "2017-04-04T11:34:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![chetanc](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chetanc/32/17028_2.png) [@chetanc](https://discuss.elastic.co/u/chetanc)\
**Post date:** [April 4, 2017, 11:34am UTC](https://discuss.elastic.co/t/mapper-attachment-plugin-on-es-2-4-4-not-working-giving-mapping-conflict-error-for-file-content/81134/1 "2017-04-04T11:34:20Z")

</div>

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": {}
    }
  }
}
```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 2, 2017, 11:34am UTC](https://discuss.elastic.co/t/mapper-attachment-plugin-on-es-2-4-4-not-working-giving-mapping-conflict-error-for-file-content/81134/2 "2017-05-02T11:34:23Z")

</div>

Closed on May 2, 2017, 11:34am UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
