# Help partial Windows directory path match

**URL:** <https://discuss.elastic.co/t/help-partial-windows-directory-path-match/77322>\
**Category:** Elasticsearch\
**Created:** [March 3, 2017, 1:54pm UTC](https://discuss.elastic.co/t/help-partial-windows-directory-path-match/77322 "2017-03-03T13:54:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![teoseller](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/teoseller/32/7454_2.png) [@teoseller](https://discuss.elastic.co/u/teoseller)\
**Post date:** [March 3, 2017, 1:54pm UTC](https://discuss.elastic.co/t/help-partial-windows-directory-path-match/77322/1 "2017-03-03T13:54:58Z")

</div>

Dear,

i need to match a partial directory path.  
Example i have that path C:\Windows\system32\config\systemprofile\AppData\Roaming\ , and i want to match in a query only the first part of the path C:\Windows\system32 .

Who can help me understand how can i do?

Thank you a lot.

---

<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:** [March 3, 2017, 2:06pm UTC](https://discuss.elastic.co/t/help-partial-windows-directory-path-match/77322/2 "2017-03-03T14:06:38Z")

</div>

I'd use a path tokenizer: [https://www.elastic.co/guide/en/elasticsearch/reference/5.2/analysis-pathhierarchy-tokenizer.html](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/analysis-pathhierarchy-tokenizer.html)

---

<div class="post-metadata">

**Author:** ![teoseller](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/teoseller/32/7454_2.png) [@teoseller](https://discuss.elastic.co/u/teoseller)\
**Post date:** [March 3, 2017, 4:06pm UTC](https://discuss.elastic.co/t/help-partial-windows-directory-path-match/77322/3 "2017-03-03T16:06:37Z")

</div>

Thank you Davide, i just use toke but i don't know why but the token is not match and the query is null.

it's really strange!!!

---

<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 31, 2017, 4:06pm UTC](https://discuss.elastic.co/t/help-partial-windows-directory-path-match/77322/4 "2017-03-31T16:06:38Z")

</div>

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