# PathHierarchy in index mapping no longer working in Elasticsearch 2.0

**URL:** <https://discuss.elastic.co/t/pathhierarchy-in-index-mapping-no-longer-working-in-elasticsearch-2-0/33951>\
**Category:** Elasticsearch\
**Created:** [November 6, 2015, 7:17am UTC](https://discuss.elastic.co/t/pathhierarchy-in-index-mapping-no-longer-working-in-elasticsearch-2-0/33951 "2015-11-06T07:17:25Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![ian1](https://avatars.discourse-cdn.com/v4/letter/i/ebca7d/32.png) [@ian1](https://discuss.elastic.co/u/ian1)\
**Post date:** [November 6, 2015, 7:17am UTC](https://discuss.elastic.co/t/pathhierarchy-in-index-mapping-no-longer-working-in-elasticsearch-2-0/33951/1 "2015-11-06T07:17:25Z")

</div>

Hi,

I upgraded my elasticsearch cluster from version 1.7 to 2.0. When I tried to start the upgraded elasticsearch, it didn't initialize and it kept outputting the following message to the log file:

```
[2015-11-06 03:26:41,191][WARN][cluster.action.shard] [Aardwolf] [demo05][0] received shard failed for [demo05][0], node[417Bdz9fR-6M0-06JAorJw], [P], v[48267], s[INITIALIZING], a[id=9K3heegXTy-_EJE7QVNPRg], unassigned_info[[reason=ALLOCATION_FAILED], at[2015-11-06T03:26:41.172Z], details[failed to create index, failure IndexCreationException[failed to create index]; nested: IllegalArgumentException[Unknown Tokenizer type [PathHierarchy] for [win_path_hierarchy]]; ]], indexUUID [J2Vp_LEGQxSCYnXh_qCePw], message [failed to create index], failure [IndexCreationException[failed to create index]; nested: IllegalArgumentException[Unknown Tokenizer type [PathHierarchy] for [win_path_hierarchy]]; ]
[demo05] IndexCreationException[failed to create index]; nested: IllegalArgumentException[Unknown Tokenizer type [PathHierarchy] for [win_path_hierarchy]];

```

My index mapping file has the following definition:

```
 "settings" :
 {
  "analysis" :
  {
     "analyzer" :
     {
         "win_path" :
         {
            "type" : "custom",
            "tokenizer" : "win_path_hierarchy"
         },
         "backslash" :
         {
            "type" : "pattern",
            "pattern" : "\\\\"
         }
     },
     "tokenizer" :
     {
        "win_path_hierarchy" :
        {
           "type" : "PathHierarchy",
           "delimiter" : "\\"
        }
     }
  }
 }

```

It worked well in elasticsearch 1.7. Is this expected? Is there any way I can recover from this error?

Thanks,  
Ian

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [November 6, 2015, 7:36am UTC](https://discuss.elastic.co/t/pathhierarchy-in-index-mapping-no-longer-working-in-elasticsearch-2-0/33951/2 "2015-11-06T07:36:00Z")

</div>

You need to use `path_hierarchy` instead of `PathHierarchy`. We used to support both formats but we only documented the former one.

---

<div class="post-metadata">

**Author:** ![ian1](https://avatars.discourse-cdn.com/v4/letter/i/ebca7d/32.png) [@ian1](https://discuss.elastic.co/u/ian1)\
**Post date:** [November 6, 2015, 7:40am UTC](https://discuss.elastic.co/t/pathhierarchy-in-index-mapping-no-longer-working-in-elasticsearch-2-0/33951/3 "2015-11-06T07:40:40Z")

</div>

Thank you so much for the quick reply, David.

Do you know if there is anyway I can recover from this, like running some command or manually modifying some internal files in elasticsearch?

Thanks,  
Ian

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [November 6, 2015, 8:33am UTC](https://discuss.elastic.co/t/pathhierarchy-in-index-mapping-no-longer-working-in-elasticsearch-2-0/33951/4 "2015-11-06T08:33:23Z")

</div>

There is sadly nothing out of the box for this.  
The shortest way if possible is to reindex.

It might be possible to write a Java program which reads the old mapping and transforms it to the new version.

May be you should open an issue and ask for this but I can't tell if it will be accepted.

Did the update plugin show you that error?

---

<div class="post-metadata">

**Author:** ![ian1](https://avatars.discourse-cdn.com/v4/letter/i/ebca7d/32.png) [@ian1](https://discuss.elastic.co/u/ian1)\
**Post date:** [November 6, 2015, 8:40am UTC](https://discuss.elastic.co/t/pathhierarchy-in-index-mapping-no-longer-working-in-elasticsearch-2-0/33951/5 "2015-11-06T08:40:23Z")

</div>

Thank again for the help David.

I only have one plugin: cloud-aws. I am not sure if the error came from the plugin. I simply checked out the /var/log/elasticsearch/[mycluser].log file.

Thanks,  
Ian

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [November 6, 2015, 9:54am UTC](https://discuss.elastic.co/t/pathhierarchy-in-index-mapping-no-longer-working-in-elasticsearch-2-0/33951/6 "2015-11-06T09:54:21Z")

</div>

That was not my question. I was asking if you installed the [migration plugin](https://github.com/elastic/elasticsearch-migration) before trying to upgrade to 2.0. (sorry I wrote update plugin but I meant migration plugin)

---

<div class="post-metadata">

**Author:** ![ian1](https://avatars.discourse-cdn.com/v4/letter/i/ebca7d/32.png) [@ian1](https://discuss.elastic.co/u/ian1)\
**Post date:** [November 6, 2015, 6:59pm UTC](https://discuss.elastic.co/t/pathhierarchy-in-index-mapping-no-longer-working-in-elasticsearch-2-0/33951/7 "2015-11-06T18:59:33Z")

</div>

I thought I probably misunderstood your question. No, I didn't not the migration plugin first.

Thanks,  
Ian

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [November 6, 2015, 7:12pm UTC](https://discuss.elastic.co/t/pathhierarchy-in-index-mapping-no-longer-working-in-elasticsearch-2-0/33951/8 "2015-11-06T19:12:04Z")

</div>

It was built to detect such problems. So I'm curious if it would have detect this case. Could you run it by any chance?  
It does not require any restart.

---

<div class="post-metadata">

**Author:** ![ian1](https://avatars.discourse-cdn.com/v4/letter/i/ebca7d/32.png) [@ian1](https://discuss.elastic.co/u/ian1)\
**Post date:** [November 7, 2015, 12:36am UTC](https://discuss.elastic.co/t/pathhierarchy-in-index-mapping-no-longer-working-in-elasticsearch-2-0/33951/9 "2015-11-07T00:36:21Z")

</div>

David, unfortunately, I am no longer able to start my elasticsearch service. I tried downgrading my elasticsearch service and starting the service and it failed. The log file complained about something in the index unknown.

My understanding is that the migration plugin requires a running elasticsearch service. Let me know if that is not the case.

Thanks,  
Ian

---

<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, 11:40pm UTC](https://discuss.elastic.co/t/pathhierarchy-in-index-mapping-no-longer-working-in-elasticsearch-2-0/33951/10 "2017-07-05T23:40:03Z")

</div>


