Skip to content

Instantly share code, notes, and snippets.

@spati-java
Created September 14, 2018 14:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spati-java/899f82027882a441c27911e1e2578cd4 to your computer and use it in GitHub Desktop.
Save spati-java/899f82027882a441c27911e1e2578cd4 to your computer and use it in GitHub Desktop.
public ProfileDocument findById(String id) throws Exception {
GetRequest getRequest = new GetRequest(INDEX, TYPE, id);
GetResponse getResponse = client.get(getRequest, RequestOptions.DEFAULT);
Map<String, Object> resultMap = getResponse.getSource();
return objectMapper
.convertValue(resultMap, ProfileDocument.class);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment