# Startwith query not working if string has hyphen (-)

**URL:** <https://discuss.elastic.co/t/startwith-query-not-working-if-string-has-hyphen/120146>\
**Category:** Elasticsearch\
**Created:** [February 16, 2018, 10:36am UTC](https://discuss.elastic.co/t/startwith-query-not-working-if-string-has-hyphen/120146 "2018-02-16T10:36:42Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [February 16, 2018, 10:50am UTC](https://discuss.elastic.co/t/startwith-query-not-working-if-string-has-hyphen/120146/2 "2018-02-16T10:50:30Z")

</div>

That's most likely a question of analyzer.

Have a look at how elasticsearch indexed your document using the `_analyze` API.  
Note that wildcard queries are not analyzed and must exactly match with what you have in the inverted index.

If you don't succeed, please provide a full recreation script as described in [About the Elasticsearch category](https://discuss.elastic.co/t/about-the-elasticsearch-category/21). It will help to better understand what you are doing. Please, try to keep the example as simple as possible.

---

_[View the full topic](https://discuss.elastic.co/t/startwith-query-not-working-if-string-has-hyphen/120146)._
