// @param _id: the document primary key
// @param sFields: the list of fields to return (can be null - will just return null if doc doesn't exist)
// @returns: A map containing the requested fields (null if empty)
public Map<String, GetField> getDocument(String _id, String... sFields) {
GetRequestBuilder grb = _elasticClient.prepareGet(_sIndexName, _sIndexType, _id);
if (null != sFields) {
grb.setFields(sFields);
}
GetResponse gr = grb.execute().actionGet();
Map<String, GetField> fieldsMap = gr.getFields();
if (null != fieldsMap) {
if (fieldsMap.isEmpty()) {
fieldsMap = null;
}