# Having some issues with special characters and searches \[Solved\]

**URL:** <https://discuss.elastic.co/t/having-some-issues-with-special-characters-and-searches-solved/79306>\
**Category:** Elasticsearch\
**Created:** [March 20, 2017, 6:53pm UTC](https://discuss.elastic.co/t/having-some-issues-with-special-characters-and-searches-solved/79306 "2017-03-20T18:53:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![doom](https://avatars.discourse-cdn.com/v4/letter/d/a587f6/32.png) [@doom](https://discuss.elastic.co/u/doom)\
**Post date:** [March 20, 2017, 6:53pm UTC](https://discuss.elastic.co/t/having-some-issues-with-special-characters-and-searches-solved/79306/1 "2017-03-20T18:53:12Z")

</div>

I am trying to make it possible to search for a username or email.

My documents look like this:

{  
"\_index": "dump",  
"\_type": "dumps",  
"\_id": "AVrtBPc-9qPScMUXa\_Dq",  
"\_score": 1,  
"\_source": {  
"name": "random user",  
"email": "random-user@gmail.com",  
"username": "random-user123"  
}  
}

But whenever it hits a special character it returns nothing. So if I search for "random" it returns "random-user", but if I search for "random-user" it returns nothing. Same with email, the @ makes the request return nothing.

This may be a silly question, but I am fairly new to ES. Any way I could make both fields searchable with special characters? I also want them to match exact. If I search for "user" I want to to return ONLY "user" and not "user1", "user-2" or "user 123" etc.

EDIT:  
I found a solution. I changed the query to search for keywords and that seemed to do it.

---

<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:** [April 17, 2017, 6:53pm UTC](https://discuss.elastic.co/t/having-some-issues-with-special-characters-and-searches-solved/79306/2 "2017-04-17T18:53:32Z")

</div>

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