What is an API Java, to avoid special characters Elasticsearch?

I'm trying to run the following query from the Java API:

"query": { "bool" : { "must" : [ { "field" : { "space-time-id.timestamp" : "2014-03-17T16:57:47.136-07:00" } } ] } } 

This is not possible because the colon (which are special characters) matters. Can anyone point me in the Java API, which avoids these characters?

+6
source share
2 answers

org.apache.lucene.queryparser.classic.QueryParser.escape()

+11
source

You can also use org.apache.lucene.queryparser.flexible.standard.QueryParserUtil.escape()

;)

It seems that the implementation of the same.

+2
source

All Articles