@Override
public void handleRequest(final RestRequest request, final RestChannel channel, Client client) {
final String[] indices = Strings.splitStringByCommaToArray(request.param("index"));
try {
SuggestRefreshRequest suggestRefreshRequest = new SuggestRefreshRequest(indices);
if (request.hasContent()) {
XContentParser parser = XContentFactory.xContent(request.content()).createParser(request.content());
Map<String, Object> parserMap = parser.mapAndClose();
if (parserMap.containsKey("field")) {
suggestRefreshRequest.field(XContentMapValues.nodeStringValue(parserMap.get("field"), ""));
}
}
client.execute(SuggestRefreshAction.INSTANCE, suggestRefreshRequest, new RestToXContentListener<SuggestRefreshResponse>(channel));
} catch (IOException e) {