I already have a Suggest object filled with two suggestions. At this point I can't find any documentation or sample code to help guide me through fetching the suggestions from the Suggest object.
Below is how i'm fetching the Suggest Object
val generator:DirectCandidateGenerator = candidateGenerator("name")
.prefixLength(0)
.minWordLength(0)
.suggestMode("always")
.maxEdits(2);
val phraseSuggest:PhraseSuggestionBuilder = phraseSuggestion("did_you_mean")
.field("name")
.addCandidateGenerator(generator)
.text(t)
.gramSize(3);
val search = Global.getClient().prepareSearch("businesses")
.setSearchType(SearchType.QUERY_THEN_FETCH)
.setQuery(customQuery)
.setFrom(0).setSize(max)
.addSuggestion(phraseSuggest)
.execute()
.actionGet();
val suggest = search.getSuggest()
println("Suggest Size: " + suggest.size())
The above code is in Scala. It is pretty self explainatory if you understand Java. If you know the solution in Java then I can easily translate it into Scala code so no need to try and figure out Scala if you don't know it.
Any help would be greatly appreciated. Thank You
Suggestobject isIterable...not sure what I'm missing here...