Completion Suggestion Java API for ElasticSearch 5.5.1

I want to refer the following example to code the suggestions function with java for elasticsearch 5.5.1,
but I could not find the prepareSearch , addSuggestion methods like the example.
Could you help me to solve the problem , thanks very much.

CompletionSuggestionBuilder compBuilder = new CompletionSuggestionBuilder("complete");

SearchResponse searchResponse = localClient.prepareSearch(INDEX_NAME)

CompletionSuggestion compSuggestion = searchResponse.getSuggest().getSuggestion("complete");

it's not addSuggestion, but just suggest() - have you tried that?


Thank you very much.
I have noticed the java api changes.

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