In the ES documentation there is a list of reserved characters.

I'm looking for the unit tests that test reserved characters inside a 
query_string query.

Could someone kindly point me in the right direction?

Thanks!

If you need to use any of the characters which function as operators in 
your query itself (and not as operators), then you should escape them with 
a leading backslash. For instance, to search for (1+1)=2, you would need to 
write your query as \(1\+1\)=2.

The reserved characters are: + - && || ! ( ) { } [ ] ^ " ~ * ? : \ /

Failing to escape these special characters correctly could lead to a syntax 
error which prevents your query from running.

*Watch this space*

A space may also be a reserved character. For instance, if you have a 
synonym list which converts "wi fi" to "wifi", a query_string search for "wi 
fi" would fail. The query string parser would interpret your query as a 
search for "wi OR fi", while the token stored in your index is actually 
"wifi". Escaping the space will protect it from being touched by the query 
string parser: "wi\ fi".

-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elasticsearch+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/e4fa9e63-e3d4-41cd-ba9a-bff96361758d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to