# Path hierarchy mapping migration issue

**URL:** <https://discuss.elastic.co/t/path-hierarchy-mapping-migration-issue/77564>\
**Category:** Elasticsearch\
**Created:** [March 6, 2017, 6:41pm UTC](https://discuss.elastic.co/t/path-hierarchy-mapping-migration-issue/77564 "2017-03-06T18:41:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Garito](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/garito/32/8854_2.png) [@Garito](https://discuss.elastic.co/u/Garito)\
**Post date:** [March 6, 2017, 6:41pm UTC](https://discuss.elastic.co/t/path-hierarchy-mapping-migration-issue/77564/1 "2017-03-06T18:41:57Z")

</div>

Hi!  
I'm trying to upgrading my 1.7 cluster to 5.2.x but I'm encontering some troubles  
Here is my original working 1.7 default mapping:

```json
{
  "template" : "tf*",
  "settings" : {
    "index.refresh_interval" : "5s",
    "analysis": {
      "analyzer": {
        "path-analyzer": {
          "type": "custom",
          "tokenizer": "path-tokenizer"
        }
      },
      "tokenizer": {
        "path-tokenizer": {
          "type": "path_hierarchy"
        }
      }
    }
  },
  "mappings" : {
    "_default_" : {
       "_all" : {"enabled" : true},
       "dynamic_templates" : [ {
         "string_fields" : {
           "match" : "*",
           "match_mapping_type" : "string",
           "mapping" : {
             "type" : "string", "index" : "analyzed", "omit_norms" : true,
               "fields" : {
                 "raw" : {"type": "string", "index" : "not_analyzed", "ignore_above" : 256}
               }
           }
         }
       } ],
       "properties" : {
         "path" : {
          "type": "string",
          "index_analyzer": "path-analyzer",
          "search_analyzer": "keyword",
          "fields": {
            "raw": {
              "index": "not_analyzed",
              "type": "string"
            }
          }
        }
      }
    }
  }
}

```

My last attempt:

```json
{
  "template": "tf*",
  "settings": {
    "index.refresh_interval": "5s",
    "analysis": {
      "analyzer": {
        "pathAnalyzer": {
          "tokenizer": "path_hierarchy"
        }
      }
    }
  },
  "mappings": {
    "_default_": {
      "_all": {
        "enabled": true
      },
      "dynamic_templates": [
        {
          "string_fields": {
            "match_mapping_type": "string",
            "mapping": {
              "type": "keyword",
              "omit_norms": true,
              "fields": {
                "raw": {
                  "type": "text",
                  "ignore_above": 256
                }
              }
            }
          }
        }
      ],
      "properties": {
        "path": {
          "type": "keyword",
          "analyzer": "pathAnalyzer",
          "fields": {
            "raw": {
              "type": "text"
            }
          }
        }
      }
    }
  }
}

```

The error is that analyzer pathAnalyzer is an invalid parameter

Any ideas?

Thanks

---

<div class="post-metadata">

**Author:** ![Garito](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/garito/32/8854_2.png) [@Garito](https://discuss.elastic.co/u/Garito)\
**Post date:** [March 7, 2017, 1:04pm UTC](https://discuss.elastic.co/t/path-hierarchy-mapping-migration-issue/77564/2 "2017-03-07T13:04:02Z")

</div>

Thanks to Xylakant from the IRC channel the issue was resolved by changing the type from keyword to text in the path property definition

---

<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:** [April 4, 2017, 1:04pm UTC](https://discuss.elastic.co/t/path-hierarchy-mapping-migration-issue/77564/3 "2017-04-04T13:04:05Z")

</div>

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