SHARE
TWEET

Untitled

a guest Jun 18th, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. RestHighLevelClient client = new RestHighLevelClient(
  2.             RestClient.builder(new HttpHost(hostname, port, scheme))
  3.                     .setPathPrefix(pathPrefix));
  4. SearchResponse searchResponse = client.search(searchRequest, RequestOptions.DEFAULT);
  5.  
  6. for (SearchHit hit : searchResponse.getHits()) {
  7.         D dto = (D) objectMapper.readValue(
  8.                 hit.getSourceAsString(), //<-- only 10 field in _sources
  9.                 params.getDtoClass());
  10.  
  11.         ((List<D>) result.getResult()).add(dto);}
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top