# Escaping special character not working for not\_analyzed field

**URL:** <https://discuss.elastic.co/t/escaping-special-character-not-working-for-not-analyzed-field/8537>\
**Category:** Elasticsearch\
**Created:** [July 27, 2012, 1:15pm UTC](https://discuss.elastic.co/t/escaping-special-character-not-working-for-not-analyzed-field/8537 "2012-07-27T13:15:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![manoj\_2](https://avatars.discourse-cdn.com/v4/letter/m/e0b2c6/32.png) [@manoj\_2](https://discuss.elastic.co/u/manoj_2)\
**Post date:** [July 27, 2012, 1:15pm UTC](https://discuss.elastic.co/t/escaping-special-character-not-working-for-not-analyzed-field/8537/1 "2012-07-27T13:15:15Z")

</div>

Hi All,

Please excuse if it is already asked.

I am facing a weird situation of search not returning any hits, even on  
escaping the special characters during search. The search field is  
not\_analyzed.

This is how data is indexed in the cluster.

{  
"took":516,  
"timed\_out":false,  
"\_shards":{  
"total":1,  
"successful":1,  
"failed":0  
},  
"hits":{  
"total":2,  
"max\_score":1.0,  
"hits":[  
{  
"\_index":"moreovercontact",  
"\_type":"moreovercontact",  
"\_id":"1322",  
"\_score":1.0,  
"\_source":{  
"contactid":"1322",  
"contactname":"Wanda "Blueberry Freak" C.",  
"email":"",  
"sourceid":"4715"  
}  
}  
]  
}  
}

The search request builder I used to pick data from the index is:

{  
"from":0,  
"size":10,  
"query":{  
"bool":{  
"should":{  
"bool":{  
"must":[  
{  
"query\_string":{  
"query":"Wanda "Blueberry Freak" C.",  
"fields":[  
"contactname.sort"  
],  
"use\_dis\_max":true  
}  
},  
{  
"query\_string":{  
"query":"4715",  
"fields":[  
"sourceid"  
],  
"use\_dis\_max":true  
}  
}  
]  
}  
}  
}  
},  
"explain":true,  
"fields":[  
"contactid",  
"contactname"  
]  
}

Hope I have escaped the special character in the query string in right  
way. Let me know if I need to provide any more information regarding this

Could anybody help me on this problem?

Thank You!  
Manoj

---

<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:** [July 6, 2017, 3:18am UTC](https://discuss.elastic.co/t/escaping-special-character-not-working-for-not-analyzed-field/8537/2 "2017-07-06T03:18:47Z")

</div>


