# Illegal Characters?

**URL:** <https://discuss.elastic.co/t/illegal-characters/3295>\
**Category:** Elasticsearch\
**Created:** [September 2, 2010, 4:36pm UTC](https://discuss.elastic.co/t/illegal-characters/3295 "2010-09-02T16:36:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bailey](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bailey/32/3278_2.png) [@bailey](https://discuss.elastic.co/u/bailey)\
**Post date:** [September 2, 2010, 4:36pm UTC](https://discuss.elastic.co/t/illegal-characters/3295/1 "2010-09-02T16:36:22Z")

</div>

Hi All -

Is there a list of characters that are "illegal" in query strings?

For example, I'm seeing errors when I perform the following search:

{  
"query":  
{  
"field" :  
{  
"username" : "hello{World"  
}  
}  
}

It appears the bracket is what is causing the error. I also noticed a  
parenthesis will cause the same errors.

Thanks.

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [September 2, 2010, 4:45pm UTC](https://discuss.elastic.co/t/illegal-characters/3295/2 "2010-09-02T16:45:45Z")

</div>

Hiya

> Is there a list of characters that are "illegal" in query strings?

It's not so much that characters are illegal, as that they have a  
certain meaning:

See [Apache Lucene - Query Parser Syntax](http://lucene.apache.org/java/3_0_0/queryparsersyntax.html)  
and especially:

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

clint

---

<div class="post-metadata">

**Author:** ![bailey](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bailey/32/3278_2.png) [@bailey](https://discuss.elastic.co/u/bailey)\
**Post date:** [September 2, 2010, 4:51pm UTC](https://discuss.elastic.co/t/illegal-characters/3295/3 "2010-09-02T16:51:32Z")

</div>

Great.  
Thanks for pointing out those links.  
I was hoping this was the case.

Cheers!

On Sep 2, 12:45 pm, Clinton Gormley [clin...@iannounce.co.uk](mailto:clin...@iannounce.co.uk) wrote:

> Hiya
> 
> > Is there a list of characters that are "illegal" in query strings?
> 
> It's not so much that characters are illegal, as that they have a  
> certain meaning:
> 
> Seehttp://lucene.apache.org/java/3\_0\_0/queryparsersyntax.html  
> and especially:
> 
> [Apache Lucene - Query Parser Syntax](http://lucene.apache.org/java/3_0_0/queryparsersyntax.html#Escaping%252)...
> 
> clint

---

<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, 4:19am UTC](https://discuss.elastic.co/t/illegal-characters/3295/4 "2017-07-06T04:19:49Z")

</div>


