# Querystring search on special characters

**URL:** <https://discuss.elastic.co/t/querystring-search-on-special-characters/192305>\
**Category:** Elasticsearch\
**Created:** [July 25, 2019, 7:22pm UTC](https://discuss.elastic.co/t/querystring-search-on-special-characters/192305 "2019-07-25T19:22:54Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![gabriel\_tessier](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gabriel_tessier/32/27911_2.png) [@gabriel\_tessier](https://discuss.elastic.co/u/gabriel_tessier)\
**Post date:** [July 26, 2019, 12:13am UTC](https://discuss.elastic.co/t/querystring-search-on-special-characters/192305/2 "2019-07-26T00:13:38Z")

</div>

Hi @diliprajamani1

The problem is that query string use the lucene syntax and "!" is a special characters, that you need to escape.

> Lucene supports escaping special characters that are part of the query syntax. The current list special characters are
> 
> - 
> - && || ! ( ) { } ^ " ~ \* ? : \

[http://lucene.apache.org/core/3\_4\_0/queryparsersyntax.html#Escaping%20Special%20Characters](http://lucene.apache.org/core/3_4_0/queryparsersyntax.html#Escaping%20Special%20Characters)

Here a similar discussion:

> [@Escaping Special Characters in Wildcard Query](https://discuss.elastic.co/t/escaping-special-characters-in-wildcard-query/5819/2):
>
> Hi Dawi The elasticsearch documentation says that "The wildcard query maps to lucene WildcardQuery". [http://www.elasticsearch.org/guide/reference/query-dsl/wildcard-query.html](http://www.elasticsearch.org/guide/reference/query-dsl/wildcard-query.html) The Lucene documentation says that there is the following list of special characters: && || ! ( ) { } [] ^ " ~ \* ? : and that they can be escaped using the \ before the character. [http://lucene.apache.org/java/3\_4\_0/queryparsersyntax.html#Escaping%](http://lucene.apache.org/java/3_4_0/queryparsersyntax.html#Escaping%25) 20Special%20Characters These special characters apply …

---

_[View the full topic](https://discuss.elastic.co/t/querystring-search-on-special-characters/192305)._
