# Term query with special character

**URL:** <https://discuss.elastic.co/t/term-query-with-special-character/101485>\
**Category:** Elasticsearch\
**Created:** [September 22, 2017, 12:45pm UTC](https://discuss.elastic.co/t/term-query-with-special-character/101485 "2017-09-22T12:45:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Moumita\_Mandal](https://avatars.discourse-cdn.com/v4/letter/m/aca169/32.png) [@Moumita\_Mandal](https://discuss.elastic.co/u/Moumita_Mandal)\
**Post date:** [September 22, 2017, 12:45pm UTC](https://discuss.elastic.co/t/term-query-with-special-character/101485/1 "2017-09-22T12:45:50Z")

</div>

Hello,

I am using Elasticsearch version "5.3.2".

I am trying to write a query that will match exact text/string.

The query looks like this:  
{  
query: {  
bool: {  
must: {  
match: {  
userEmail: "abc@xyz.com"  
}  
},  
filter: {  
term: { questionText: searchText }  
}  
}  
},  
size: limit,  
from: skip,  
}

**searchText** could be

1. 5
2. 5\*2
3. 10/5
4. How are you?

When I am passing **5** or **2** or **10** or **how** as the **searchText** it is working fine and I am getting desired output.  
But whenever I am passing **5\*2** or **how are** as the **searchText** I am not getting any result.

Is this possible to use term query for exact matching of a string containing a special character or white space?

---

<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:** [October 20, 2017, 12:45pm UTC](https://discuss.elastic.co/t/term-query-with-special-character/101485/2 "2017-10-20T12:45:56Z")

</div>

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