Phrase suggester collate query in java api

The PhraseSuggestionBuilder in elasticsearch java API has a collateQuery method that takes a String as input. but there is a problem, this code:

collateQuery("\"match\": {\"title.phrase\" : \"{{suggestion}}\"}")

will result in something like this:

"collate" : {
"query" : "\"match\": {\"title\" : \"{{suggeston}}\"}"
}

as you see the escaped quotes are still there and I get "failed to derive xcontent" error. I can not find an example of collateQuery using java api. what should I do?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.