# Path hierarchy (Include, Exclude error)

**URL:** <https://discuss.elastic.co/t/path-hierarchy-include-exclude-error/75451>\
**Category:** Elasticsearch\
**Created:** [February 17, 2017, 8:50am UTC](https://discuss.elastic.co/t/path-hierarchy-include-exclude-error/75451 "2017-02-17T08:50:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Emrah](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/emrah/32/17657_2.png) [@Emrah](https://discuss.elastic.co/u/Emrah)\
**Post date:** [February 17, 2017, 8:50am UTC](https://discuss.elastic.co/t/path-hierarchy-include-exclude-error/75451/1 "2017-02-17T08:50:56Z")

</div>

Hey there,

we have been using path hierarchy for the Category Facets and everything was fine since we decided to upgrade to **2.2 from 5.x** version of Elasticsearch. Let me tell you why.

Here is an example of our category hierarchy with a **path hierarchy tokinezer** and the **delimeter** is **""** ;

categoryHierarchyField = a\b\c;

so index will be like below  
a  
a\b  
a\b\c

and here is the problem in 5.0 version of elastic in aggregations ;  
"aggs":{  
"cats":{  
"terms":{  
"field":"cat",  
"exclude":{  
"pattern":"._path._._|._|.\*"  
}  
}  
}  
}  
}  
So according to this [https://github.com/elastic/elasticsearch/issues/22933](https://github.com/elastic/elasticsearch/issues/22933) issue, this is a bug. Beyond that, you say include and exclude will be deprecated.  
Is there any way to help me to aggregate category hierarchy and sort out the only problem between us and elasticsearch v 5.0 ?

---

<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 17, 2017, 8:51am UTC](https://discuss.elastic.co/t/path-hierarchy-include-exclude-error/75451/2 "2017-03-17T08:51:12Z")

</div>

Closed on March 17, 2017, 8:51am UTC

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