使用netstat -lntp来看看有侦听在网络某端口的进程。当然,也可以使用 lsof。

spring data elasticsearch怎么设置返回值的条数

Elasticsearch | 作者 kennys | 发布于2018年11月27日 | 阅读数:4462

在elasticsearch中可以通过设置size,在spring data中该怎么做能设置size。
自己解决了,用了pageable,设置分页的大小。
已邀请:

rochy - rochy_he

赞同来自:

可以的,推荐把代码贴出来

kennys

赞同来自:

大概是这么做的在service中:我定义了pageable的大小

private Pageable pageable = PageRequest.of(0, 10000);
 
然后在repository中声明是就在参数中带上Pageable

List<StatisticsEventPO> findStatisticsEventPOSByBasic_ClassIdAndBasic_LessonNumAndName(String classId,int lessonNum,String name,Pageable pageable);
 
这样在service中使用时直接用定义好的pageable作为参数
 

要回复问题请先登录注册