I am working on ES5 through java, and am trying to add context to a CompletionSuggestionBuilder. I have a map of String objects that need to be added. The code I have so far is -
Map<String, String> context = ...
CompletionSuggestionBuilder csb = SuggestBuilders.completionSuggestion(field).text(value).size(count);
How do I add context objects to csb
? I think the method to use is -
csb.contexts(Map<String, List<? extends ToXContent>> queryContexts)
But I don't know how to get from my map to the map to pass as arguments to the contexts method.