@Override public <T> FacetedPage<T> queryForPage( StringQuery query, Class<T> clazz, SearchResultMapper mapper) { SearchResponse response = prepareSearch(query, clazz).setQuery(query.getSource()).execute().actionGet(); return mapper.mapResults(response, clazz, query.getPageable()); }
@Override public <T> Page<T> scroll(String scrollId, long scrollTimeInMillis, SearchResultMapper mapper) { SearchResponse response = client .prepareSearchScroll(scrollId) .setScroll(TimeValue.timeValueMillis(scrollTimeInMillis)) .execute() .actionGet(); return mapper.mapResults(response, null, null); }
@Override public <T> FacetedPage<T> queryForPage( SearchQuery query, Class<T> clazz, SearchResultMapper mapper) { SearchResponse response = doSearch(prepareSearch(query, clazz), query); return mapper.mapResults(response, clazz, query.getPageable()); }