Java ES 分页查询

Java ES 分页查询

  • 1 分页查询

1 分页查询

从第n页开始每页查询每条

NativeSearchQueryBuilder builder = new NativeSearchQueryBuilder();
PageRequest page = PageRequest.of(0, 10);
builder.withQuery(query).withPageable(page);
Query search = builder.build();
SearchHits<Student> lists = restTemplate.search(search, Student.class, IndexCoordinates.of(indexName));

你可能感兴趣的:(java,elasticsearch,开发语言)