SearchParseException for query strings with parens in them?

Once we started getting more realistic data into our ElasticSearch index
for manual testing purposes, we ran into SearchPhaseExecutionException for
queries containing a paren.

Example query:

curl -X GET 'http://localhost:9200/myindex/mytype/_search?' -d
'{"query":{"bool":{"must":[{"query_string":{"query":"town(","fields":["_all"]}}]}}}'

Error message:

SearchPhaseExecutionException[Failed to execute phase [query_fetch], total
failure; shardFailures {[JJfyNzxcR4WKsY-0nJdoJA][dpla][0]:
SearchParseException[[dpla][0]: from[-1],size[-1]: Parse Failure [Failed to
parse source
[{"query":{"bool":{"must":[{"query_string":{"query":"town(","fields":["_all"]}}]}},"size":10,"from":0}]]];
nested: QueryParsingException[[dpla] Failed to parse query [town(]];
nested: ParseException[Cannot parse 'town(': Encountered "" at line 1,
column 5.
Was expecting one of:
...
[SNIP FOR BREVITY]

What's the best practice for preventing parse errors like this. Is there
documentation on this situation/requirement?

Thanks all!

-Phunk

--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.