Elasticsearch version: 5.2.1
Description of the problem including expected versus actual behavior:
Calling the setGlobalText method on SuggestBuilder should be a shortcut to setting the text() property on each SuggestionBuilder added to the SuggestBuilder. Currently setting just the global text causes the Suggest object returned by SearchResponse to be null.
Steps to reproduce:
`
String searchText = "foo";
SuggestBuilder suggestBuilder = new SuggestBuilder();
suggestBuilder.setGlobalText(searchText);
SuggestionBuilder<?> suggestionBuilder = SuggestBuilders.completionSuggestion("fieldName");
// suggestionBuilder.text(searchText);
// uncomment the line above and the searchResponse#getResponse will exist as expected
suggestBuilder.addSuggestion("suggestion-name", suggestionBuilder);
searchResponse.getSuggest() // This is null when only the global text is set.
`
The Suggest instance should not be null if the global text is set on the SuggestBuilder.
Elasticsearch version: 5.2.1
Description of the problem including expected versus actual behavior:
Calling the setGlobalText method on SuggestBuilder should be a shortcut to setting the text() property on each SuggestionBuilder added to the SuggestBuilder. Currently setting just the global text causes the Suggest object returned by SearchResponse to be null.
Steps to reproduce:
`
String searchText = "foo";
SuggestBuilder suggestBuilder = new SuggestBuilder();
suggestBuilder.setGlobalText(searchText);
SuggestionBuilder<?> suggestionBuilder = SuggestBuilders.completionSuggestion("fieldName");
// suggestionBuilder.text(searchText);
// uncomment the line above and the searchResponse#getResponse will exist as expected
suggestBuilder.addSuggestion("suggestion-name", suggestionBuilder);
searchResponse.getSuggest() // This is null when only the global text is set.
`
The Suggest instance should not be null if the global text is set on the SuggestBuilder.