SuggestRequest suggestRequest = new SuggestRequest(indices);
suggestRequest.field(XContentMapValues.nodeStringValue(parserMap.get("field"), ""));
suggestRequest.suggestType(XContentMapValues.nodeStringValue(parserMap.get("type"), ""));
if (parserMap.containsKey("analyzer")) {
suggestRequest.indexAnalyzer(XContentMapValues.nodeStringValue(parserMap.get("analyzer"), ""));
suggestRequest.queryAnalyzer(XContentMapValues.nodeStringValue(parserMap.get("analyzer"), ""));
} else {
suggestRequest.indexAnalyzer(XContentMapValues.nodeStringValue(parserMap.get("indexAnalyzer"), ""));
suggestRequest.queryAnalyzer(XContentMapValues.nodeStringValue(parserMap.get("queryAnalyzer"), ""));
}
suggestRequest.term(XContentMapValues.nodeStringValue(parserMap.get("term"), ""));