public SuggestionSearchContext build(QueryShardContext context) throws IOException { SuggestionSearchContext suggestionSearchContext = new SuggestionSearchContext(); for (Entry<String, SuggestionBuilder<?>> suggestion : suggestions.entrySet()) { SuggestionContext suggestionContext = suggestion.getValue().build(context); if (suggestionContext.getText() == null) { if (globalText == null) { throw new IllegalArgumentException("The required text option is missing"); } suggestionContext.setText(BytesRefs.toBytesRef(globalText)); } suggestionSearchContext.addSuggestion(suggestion.getKey(), suggestionContext); } return suggestionSearchContext; }
public SuggestionSearchContext build(QueryShardContext context) throws IOException { SuggestionSearchContext suggestionSearchContext = new SuggestionSearchContext(); for (Entry<String, SuggestionBuilder<?>> suggestion : suggestions.entrySet()) { SuggestionContext suggestionContext = suggestion.getValue().build(context); if (suggestionContext.getText() == null) { if (globalText == null) { throw new IllegalArgumentException("The required text option is missing"); } suggestionContext.setText(BytesRefs.toBytesRef(globalText)); } suggestionSearchContext.addSuggestion(suggestion.getKey(), suggestionContext); } return suggestionSearchContext; }
public SuggestionSearchContext build(QueryShardContext context) throws IOException { SuggestionSearchContext suggestionSearchContext = new SuggestionSearchContext(); for (Entry<String, SuggestionBuilder<?>> suggestion : suggestions.entrySet()) { SuggestionContext suggestionContext = suggestion.getValue().build(context); if (suggestionContext.getText() == null) { if (globalText == null) { throw new IllegalArgumentException("The required text option is missing"); } suggestionContext.setText(BytesRefs.toBytesRef(globalText)); } suggestionSearchContext.addSuggestion(suggestion.getKey(), suggestionContext); } return suggestionSearchContext; }
public SuggestionSearchContext build(QueryShardContext context) throws IOException { SuggestionSearchContext suggestionSearchContext = new SuggestionSearchContext(); for (Entry<String, SuggestionBuilder<?>> suggestion : suggestions.entrySet()) { SuggestionContext suggestionContext = suggestion.getValue().build(context); if (suggestionContext.getText() == null) { if (globalText == null) { throw new IllegalArgumentException("The required text option is missing"); } suggestionContext.setText(BytesRefs.toBytesRef(globalText)); } suggestionSearchContext.addSuggestion(suggestion.getKey(), suggestionContext); } return suggestionSearchContext; }