# Path\_hierarchy with custom delimiter fails when values starts with a number

**URL:** <https://discuss.elastic.co/t/path-hierarchy-with-custom-delimiter-fails-when-values-starts-with-a-number/53193>\
**Category:** Elasticsearch\
**Created:** [June 17, 2016, 9:24pm UTC](https://discuss.elastic.co/t/path-hierarchy-with-custom-delimiter-fails-when-values-starts-with-a-number/53193 "2016-06-17T21:24:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![slelong](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/slelong/32/10393_2.png) [@slelong](https://discuss.elastic.co/u/slelong)\
**Post date:** [June 17, 2016, 9:24pm UTC](https://discuss.elastic.co/t/path-hierarchy-with-custom-delimiter-fails-when-values-starts-with-a-number/53193/1 "2016-06-17T21:24:59Z")

</div>

Hi guys,

I'm facing a weird issue using path\_hierarchy with delimiter ".". When part of the path starts with a number, some queries fail. When all parts start with a letter, it works fine. So, in the following example:

- “NM\_052827.a4" works fine (values on each part of “.” start with “N” and “a”)
- "nm\_001798.1" fails, a value starts with number “1”.

Here’s the issue I’ve been able to narrow down:

**1. define custom tokenizer in settings**  
`curl -XPUT 'http://localhost:9200/testindex' -d ' { "settings": { "index": { "analysis": { "analyzer": { "dot_analyzer": { "type": "custom", "tokenizer": "dot_tokenizer" } }, "tokenizer": { "dot_tokenizer": { "type": "path_hierarchy", "delimiter": "." } } } } } }'`

**2. define mapping**  
`curl -XPUT 'http://localhost:9200/testindex/_mapping/onetype' -d ' { "onetype": { "properties": { "root": { "analyzer": "dot_analyzer", "type": "string" }, "nested": { "dynamic": "false", "properties": { "one": { "analyzer": "dot_analyzer", "type": "string" }, "two": { "analyzer": "dot_analyzer", "type": "string" } } } } } } '`

**3. save doc**  
`curl -XPUT 'http://localhost:9200/testindex/onetype/1017' -d '{ "root" : "root1.value1", "nested": { "one": ["nested1.one1", "nested2.one2", "nested3.one3"], "two": ["NM_001290230.4", "NM_052827.a4", "XM_011537732.4", "nested4.4", "nested4001798.two1", "NM_4001798.two1", "nm_001798.1"] } }'`

**4. works OK**  
`curl -XPOST 'http://localhost:9200/testindex/onetype/_search' -d '{ "query": { "query_string": { "query": "nm_4001798", "default_operator": "AND", "auto_generate_phrase_queries": true } } }'`

**5. but this one fails.**  
`curl -XPOST 'http://localhost:9200/testindex/onetype/_search' -d '{ "query": { "query_string": { "query": "nm_001798", "default_operator": "AND", "auto_generate_phrase_queries": true } } }'`

**6. though using field explicitly, it works…**  
`curl -XPOST 'http://localhost:9200/testindex/onetype/_search' -d '{ "query": { "query_string": { "query": "nested.two:nm_001798", "default_operator": "AND", "auto_generate_phrase_queries": true } } }'`

So, is there something wrong with my settings/queries ? Or is this a bug somewhere near path\_hierarchy tokenizer ?

I'm using ES 2.3

Thanks  
Best,  
Sebastien.

---

<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:42pm UTC](https://discuss.elastic.co/t/path-hierarchy-with-custom-delimiter-fails-when-values-starts-with-a-number/53193/2 "2017-07-05T22:42:38Z")

</div>


