Hello,
I am trying to search with suggestion using the Java Client.
In my first approach I write the code:
client.search(request -> request.
index(indexName).
suggest(suggest -> suggest.suggesters("suggest", value -> value.
term(v -> v.
field("ocr_text").maxTermFreq(Float.valueOf("10")).suggestMode(SuggestMode.Always))).text("test")), HashMap.class);
The request crashes on client with error:
co.elastic.clients.json.JsonpMappingException: Error deserializing co.elastic.clients.elasticsearch.core.search.TermSuggest: co.elastic.clients.json.UnexpectedJsonEventException: Unexpected JSON event 'START_ARRAY' instead of '[START_OBJECT, KEY_NAME]' (JSON path: suggest['term#suggest'][0].options) (line no=1, column no=236, offset=-1)
at co.elastic.clients.json.JsonpMappingException.from0(JsonpMappingException.java:134)
The client java release is 8.1.3.
Many thanks
Ciao,
Matteo