The PhraseSuggestionBuilder in 1.6.0 of the elasticsearch java API has a collateQuery method that takes a String.
builder
.collateQuery("\"match\": {\"title\" : \"{{suggestion}}\"}")
.collatePrune(true);
Unfortunately the escaped quotes are escaped by the builder to produce JSON like this:
"collate" : {
"query" : "\"match\": {\"title\" : \"{{suggestion}}\"}",
"prune" : true
}
Anyone any ideas how I can stop this String being escaped as the JSON is generated?
Thanks.