# Wrong Mapping Syntax after upgrade, help needed

**URL:** <https://discuss.elastic.co/t/wrong-mapping-syntax-after-upgrade-help-needed/121059>\
**Category:** Elasticsearch\
**Created:** [February 22, 2018, 2:07pm UTC](https://discuss.elastic.co/t/wrong-mapping-syntax-after-upgrade-help-needed/121059 "2018-02-22T14:07:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![LethalMaus](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lethalmaus/32/28050_2.png) [@LethalMaus](https://discuss.elastic.co/u/LethalMaus)\
**Post date:** [February 22, 2018, 2:07pm UTC](https://discuss.elastic.co/t/wrong-mapping-syntax-after-upgrade-help-needed/121059/1 "2018-02-22T14:07:38Z")

</div>

Hi,  
I'm in need of some help with my Mapping template.  
I previously had Elasticsearch 1.7.3 which was accidentally upgraded to 5.4.3 within one of our work projects (its a complicated story). We could downgrade it back to its previous version but I would rather continue either with this version or even a further stable version.  
After spending some time researching as to how it should be, I was unable to fully grasp how to convert my old mappings to the required standard. I'm reasonably new to Elasticsearch & am the only developer who works with it (a.t.m.) where I am.  
The "technical environment, sizing, architecture, nodes..." should be in this case irrelevant due to it being a simple mapping template, however if this information is needed I will post it afterwards  
The Mapping is as follows:

```
POST /_template/all
{
  "order": 0,
  "template": "*",
  "settings": {
    "index": {
      "analysis": {
        "filter": {
          "preserve_original": "true",
          "patterns": [
            "([a-zA-Z]+[-]+[a-zA-Z]+[-]+[0-9a-zA-Z])",
            "([0-9a-zA-Z]+[-]+[0-9a-zA-Z]+)",
            "([0-9a-zA-Z]+[_]+[0-9a-zA-Z]+)",
            "([p{L}d]+)"
          ]
        },
        "ascii_folding": {
          "type": "asciifolding",
          "preserve_original": true
        }
      },
      "analyzer": {
        "InsertAnalyzer": {
          "filter": [
            "lowercase",
            "preserve_original",
            "ascii_folding"
          ],
          "type": "custom",
          "tokenizer": "keyword"
        },
        "SearchAnalyzer": {
          "filter": [
            "lowercase",
            "ascii_folding"
          ],
          "type": "custom",
          "tokenizer": "whitespace"
        }
      }
    }
  },
  "mappings": {
    "cd-db": {
      "properties": {
        "Path": {
          "include_in_all": true,
          "fielddata": true,
          "analyzer": "InsertAnalyzer",
          "type": "text",
          "fields": {
            "keyword": {
              "ignore_above": 1000,
              "boost": 10,
              "type": "keyword"
            }
          }
        },
        "CD-ID": {
          "include_in_all": false,
          "type": "long"
        },
        "Files": {
          "type": "object",
          "properties": {
            "Size": {
              "enabled": false
            },
            "File": {
              "include_in_all": true,
              "fielddata": true,
              "analyzer": "InsertAnalyzer",
              "type": "text",
              "fields": {
                "keyword": {
                  "ignore_above": 1000,
                  "type": "keyword"
                }
              }
            }
          }
        },
        "Date": {
          "include_in_all": false,
          "format": "yyyy-MM-ddHH:mm:ss||yyyy-MM-dd||epoch_millis",
          "type": "date"
        }
      }
    },
    "new_document_service": {
      "properties": {
        "DocumentsSent": {
          "type": "integer"
        },
        "FilesSent": {
          "type": "integer"
        },
        "LastID": {
          "type": "integer"
        },
        "UpdateTime": {
          "include_in_all": true,
          "format": "yyyy-MM-dd@HH:mm:ss||epoch_millis",
          "type": "date"
        }
      }
    },
    "insert_service": {
      "properties": {
        "DocumentsSent": {
          "type": "integer"
        },
        "FilesSent": {
          "type": "integer"
        },
        "LastID": {
          "type": "integer"
        },
        "InsertTime": {
          "include_in_all": true,
          "format": "yyyy-MM-dd@HH:mm:ss||epoch_millis",
          "type": "date"
        }
      }
    },
    "_default_": {
      "dynamic_templates": [
        {
          "keyword": {
            "mapping": {
              "index": true,
              "type": "keyword",
              "analyzer": "InsertAnalyzer"
            },
            "match_mapping_type": "keyword"
          }
        }
      ]
    }
  },
  "aliases": {}
}
```

---

<div class="post-metadata">

**Author:** ![LethalMaus](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lethalmaus/32/28050_2.png) [@LethalMaus](https://discuss.elastic.co/u/LethalMaus)\
**Post date:** [February 22, 2018, 2:08pm UTC](https://discuss.elastic.co/t/wrong-mapping-syntax-after-upgrade-help-needed/121059/2 "2018-02-22T14:08:20Z")

</div>

The Error received is

```
{
  "error": {
    "root_cause": [
      {
        "type": "remote_transport_exception",
        "reason": "[cmiLnYe][<IP-Removed>][indices:admin/template/put]"
      }
    ],
    "type": "illegal_argument_exception",
    "reason": "unknown setting [index.analyzer.InsertAnalyzer.filter.0] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"
  },
  "status": 400
}
```

---

<div class="post-metadata">

**Author:** ![LethalMaus](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lethalmaus/32/28050_2.png) [@LethalMaus](https://discuss.elastic.co/u/LethalMaus)\
**Post date:** [February 22, 2018, 2:15pm UTC](https://discuss.elastic.co/t/wrong-mapping-syntax-after-upgrade-help-needed/121059/3 "2018-02-22T14:15:20Z")

</div>

I also tried

```
{
  "order": 0,
  "template": "*",
  "settings": {
    "analysis": {
      "filter": {
        "preserve_original": "true",
        "patterns": [
          "([a-zA-Z]+[-]+[a-zA-Z]+[-]+[0-9a-zA-Z])",
          "([0-9a-zA-Z]+[-]+[0-9a-zA-Z]+)",
          "([0-9a-zA-Z]+[_]+[0-9a-zA-Z]+)",
          "([p{L}d]+)"
        ]
      },
      "ascii_folding": {
        "type": "asciifolding",
        "preserve_original": true
      },
      "analyzer": {
        "InsertAnalyzer": {
          "filter": [
            "lowercase",
            "preserve_original",
            "ascii_folding"
          ],
          "type": "custom",
          "tokenizer": "keyword"
        },
        "SearchAnalyzer": {
          "filter": [
            "lowercase",
            "ascii_folding"
          ],
          "type": "custom",
          "tokenizer": "whitespace"
        }
      }
    }
  },
  "mappings": {
    "cd-db": {
      "properties": {
        "Path": {
          "include_in_all": true,
          "fielddata": true,
          "analyzer": "InsertAnalyzer",
          "type": "text",
          "fields": {
            "keyword": {
              "ignore_above": 1000,
              "boost": 10,
              "type": "keyword"
            }
          }
        },
        "CD-ID": {
          "include_in_all": false,
          "type": "long"
        },
        "Files": {
          "type": "object",
          "properties": {
            "Size": {
              "enabled": false
            },
            "File": {
              "include_in_all": true,
              "fielddata": true,
              "analyzer": "InsertAnalyzer",
              "type": "text",
              "fields": {
                "keyword": {
                  "ignore_above": 1000,
                  "type": "keyword"
                }
              }
            }
          }
        },
        "Date": {
          "include_in_all": false,
          "format": "yyyy-MM-ddHH:mm:ss||yyyy-MM-dd||epoch_millis",
          "type": "date"
        }
      }
    },
    "new_document_service": {
      "properties": {
        "DocumentsSent": {
          "type": "integer"
        },
        "FilesSent": {
          "type": "integer"
        },
        "LastID": {
          "type": "integer"
        },
        "UpdateTime": {
          "include_in_all": true,
          "format": "yyyy-MM-dd@HH:mm:ss||epoch_millis",
          "type": "date"
        }
      }
    },
    "insert_service": {
      "properties": {
        "DocumentsSent": {
          "type": "integer"
        },
        "FilesSent": {
          "type": "integer"
        },
        "LastID": {
          "type": "integer"
        },
        "InsertTime": {
          "include_in_all": true,
          "format": "yyyy-MM-dd@HH:mm:ss||epoch_millis",
          "type": "date"
        }
      }
    },
    "_default_": {
      "dynamic_templates": [
        {
          "keyword": {
            "mapping": {
              "index": true,
              "type": "keyword",
              "analyzer": "InsertAnalyzer"
            },
            "match_mapping_type": "keyword"
          }
        }
      ]
    }
  },
  "aliases": {}
}

```

and got the following error

```
{
  "error": {
    "root_cause": [
      {
        "type": "settings_exception",
        "reason": "Failed to get setting group for [index.analysis.filter.] setting prefix and setting [index.analysis.filter.preserve_original] because of a missing '.'"
      }
    ],
    "type": "settings_exception",
    "reason": "Failed to get setting group for [index.analysis.filter.] setting prefix and setting [index.analysis.filter.preserve_original] because of a missing '.'"
  },
  "status": 500
}

```

I know it's probably a lot to ask, but if someone could point out my mistakes with some explanation, I would be highly appreciative.

---

<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:** [March 22, 2018, 2:15pm UTC](https://discuss.elastic.co/t/wrong-mapping-syntax-after-upgrade-help-needed/121059/4 "2018-03-22T14:15:56Z")

</div>

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