# Mapping definition has unsupported analyzer (upgrade to 2.0)

**URL:** <https://discuss.elastic.co/t/mapping-definition-has-unsupported-analyzer-upgrade-to-2-0/33835>\
**Category:** Elasticsearch\
**Created:** [November 5, 2015, 8:00am UTC](https://discuss.elastic.co/t/mapping-definition-has-unsupported-analyzer-upgrade-to-2-0/33835 "2015-11-05T08:00:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_Pocivalnik](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/david_pocivalnik/32/56098_2.png) [@David\_Pocivalnik](https://discuss.elastic.co/u/David_Pocivalnik)\
**Post date:** [November 5, 2015, 8:00am UTC](https://discuss.elastic.co/t/mapping-definition-has-unsupported-analyzer-upgrade-to-2-0/33835/1 "2015-11-05T08:00:50Z")

</div>

I'm upgrading from ES 1.7.1 to ES 2.0.0, before I defined my analyzers in elasticsearch.yml file of ES. The definitions are as below (I also tried index.analysis.analyzer.adefault: instead of indentation):

```
index: 
  analysis: 
    analyzer: 
      adefault: 
        char_filter: html_strip
        filter: "standard, lowercase"
        tokenizer: standard
        type: custom
      alang1: 
        char_filter: html_strip
        filter: "standard, lowercase, fstopde, fstemde"
        tokenizer: standard
        type: custom
      alang2: 
        char_filter: html_strip
        filter: "standard, lowercase, fstopar"
        tokenizer: standard
        type: custom
      alangen: 
        char_filter: html_strip
        filter: "standard, lowercase, fstopen, fstemen"
        tokenizer: standard
        type: custom
      alangt1: 
        type: german
      alangt2: 
        type: arabic
      alangten: 
        type: english
      angram: 
        filter: "standard, lowercase, fngram"
        tokenizer: standard
        type: custom
      aporterstem: 
        filter: "standard, lowercase, porterStem"
        tokenizer: standard
        type: custom
      asnowball1: 
        language: German2
        type: snowball
      asnowball2: 
        language: German2
        type: snowball
      asnowballen: 
        language: English
        type: snowball
      aurlemail: 
        filter: "lowercase, fngramurl"
        tokenizer: standard
        type: custom
    filter: 
      fngram: 
        max_gram: 10
        min_gram: 2
        type: nGram
      fngramurl: 
        max_gram: 20
        min_gram: 3
        type: nGram
      fstemde: 
        name: minimal_german
        type: stemmer
      fstemen: 
        name: minimal_english
        type: stemmer
      fstopar: 
        stopwords: _arabic_
        type: stop
      fstopde: 
        stopwords: _german_
        type: stop
      fstopen: 
        stopwords: _english_
        type: stop
    tokenizer: 
      tngram: 
        max_gram: 10
        min_gram: 2
        type: nGram

```

I read my mappings from a file in order to create my index. The file is defined as following:

```
{
    "files": {
        "properties": {
            "startDate": {
                "type": "date", 
                "format": "yyyy-MM-dd HH:mm:ss:SSS||yyyy-MM-dd HH:mm:ss", 
                "index": "not_analyzed",
                "store": "yes"
            },
            "fileLang1": { 
                "type": "attachment", 
                "index": "yes", 
                "analyzer": "alang1"
            }
        }
    }
}

```

When I create my index I'm getting the following exception:

```
MapperParsingException[mapping [files]]; nested: MapperParsingException[Mapping definition for [fileLang1] has unsupported parameters: [analyzer : alang1] [index : yes]];
Caused by: MapperParsingException[Mapping definition for [fileLang1] has unsupported parameters: [analyzer : alang1] [index : yes]]
    at org.elasticsearch.index.mapper.DocumentMapperParser.checkNoRemainingFields(DocumentMapperParser.java:267)
    at org.elasticsearch.index.mapper.DocumentMapperParser.checkNoRemainingFields(DocumentMapperParser.java:261)
    at org.elasticsearch.index.mapper.object.ObjectMapper$TypeParser.parseProperties(ObjectMapper.java:317)
    at org.elasticsearch.index.mapper.object.ObjectMapper$TypeParser.parseObjectOrDocumentTypeProperties(ObjectMapper.java:228)
    at org.elasticsearch.index.mapper.object.RootObjectMapper$TypeParser.parse(RootObjectMapper.java:137)
    at org.elasticsearch.index.mapper.DocumentMapperParser.parse(DocumentMapperParser.java:211)
    at org.elasticsearch.index.mapper.DocumentMapperParser.parseCompressed(DocumentMapperParser.java:192)
    at org.elasticsearch.index.mapper.MapperService.parse(MapperService.java:368)
    at org.elasticsearch.index.mapper.MapperService.merge(MapperService.java:242)
    at org.elasticsearch.cluster.metadata.MetaDataCreateIndexService$2.execute(MetaDataCreateIndexService.java:368)

```

Any ideas what I'm doing wrong? Thanks in advance.

---

<div class="post-metadata">

**Author:** ![David\_Pocivalnik](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/david_pocivalnik/32/56098_2.png) [@David\_Pocivalnik](https://discuss.elastic.co/u/David_Pocivalnik)\
**Post date:** [November 5, 2015, 2:24pm UTC](https://discuss.elastic.co/t/mapping-definition-has-unsupported-analyzer-upgrade-to-2-0/33835/2 "2015-11-05T14:24:47Z")

</div>

I think I figured it out.

Creating an index is probably much more strict now and some values might have changed, e.g. "index" accepts only three values, and "yes" ain't one of them. ([https://www.elastic.co/guide/en/elasticsearch/reference/2.0/mapping-index.html](https://www.elastic.co/guide/en/elasticsearch/reference/2.0/mapping-index.html))

I now defined "fileLang1" as following:

```
"fileLang1": {
    "type": "string",
    "index": "analyzed",
    "analyzer": "alang1"
}

```

and use a "copy\_to" from "content" of an attachment type.

```
"file": { 
    "type": "attachment", 
    "fields": {
        "title": { "store": true },
        "content_type": { "store": true, "index": "no" },
        "content": { "store": true, "term_vector": "with_positions_offsets", "type": "string", "copy_to": ["fileGrams", "fileEn", "fileLang1", "fileLang2"] },
        "date": { "store": true },
        "author": { "store": true },
        "keywords": { "store": true },
        "content_type" : { "store": true },
        "language": { "store": true }
    }
},

```

I hope I'm doing this the correct way, if not please let me know.

---

<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:** [July 5, 2017, 10:51pm UTC](https://discuss.elastic.co/t/mapping-definition-has-unsupported-analyzer-upgrade-to-2-0/33835/4 "2017-07-05T22:51:13Z")

</div>


