# How to search string containing hypen?

**URL:** https://discuss.elastic.co/t/how-to-search-string-containing-hypen/260713
**Category:** Elasticsearch
**Created:** [January 11, 2021, 12:08pm UTC](https://discuss.elastic.co/t/how-to-search-string-containing-hypen/260713 "2021-01-11T12:08:42Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Sahil\_Kumar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sahil_kumar/32/82027_2.png) [@Sahil\_Kumar](https://discuss.elastic.co/u/Sahil_Kumar)
#### Post date: [January 11, 2021, 12:08pm UTC](https://discuss.elastic.co/t/how-to-search-string-containing-hypen/260713/1 "2021-01-11T12:08:42Z")

</div>

Hi, I want to index text that contains hyphens, for example MiddleEaton-Byers but I am unable to because with the regular expression `*{seachparams}*` the results are not coming?  
Below is the query string:  
"query": {  
"query\_string": {  
"default\_operator": "OR",  
"default\_field": "patients.name",  
"query": "`*Eaton-Byers*`"  
}  
},

Can anyone please help me?

---

<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: [February 8, 2021, 12:08pm UTC](https://discuss.elastic.co/t/how-to-search-string-containing-hypen/260713/2 "2021-02-08T12:08:57Z")

</div>

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