Last active
September 20, 2018 00:46
-
-
Save spati-java/944c6af6cce8d7c09bd47157ab69a15d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private List<ProfileDocument> getSearchResult(SearchResponse response) { | |
SearchHit[] searchHit = response.getHits().getHits(); | |
List<ProfileDocument> profileDocuments = new ArrayList<>(); | |
if (searchHit.length > 0) { | |
Arrays.stream(searchHit) | |
.forEach(hit -> profileDocuments | |
.add(objectMapper | |
.convertValue(hit.getSourceAsMap(), | |
ProfileDocument.class)) | |
); | |
} | |
return profileDocuments; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment