p:数据表分页所有条目弹性搜索索引

时间:2019-03-29 17:01:05

标签: elasticsearch primefaces

我想使用可分页的primfaces数据表来显示弹性搜索索引中的所有条目。 不幸的是,以下代码仅返回10个条目。

public ArrayList<Video> getAllVideos(String indexName) throws IOException{
    makeConnection();
    SearchRequest searchRequest = new SearchRequest(indexName);
    Scroll scroll = new Scroll(TimeValue.timeValueMinutes(1L));
    searchRequest.scroll(scroll);
    SearchSourceBuilder sourceBuilder = new SearchSourceBuilder();
    sourceBuilder.query(QueryBuilders.matchAllQuery());
    searchRequest.source(sourceBuilder);

    SearchResponse searchResponse = restHighLevelClient.search(searchRequest);
    return buildResponse(searchResponse, restHighLevelClient);
}

有人有一个可行的示例来获取所有记录吗?谢谢

0 个答案:

没有答案