2
votes

how to set from/size of search result executed using spring Elasticsearchtemplate.

  • while same functionality can be performed using out of the box elasticsearch API

    NodeBuilder.nodeBuilder().node().client().prepareSearch("wsearchobject") .setQuery(QueryBuilders.matchAllQuery()) .setFrom(10) .setSize(20) .execute().actionGet();

how to set from and size parameters using elasticsearchtemplate.

2

2 Answers

1
votes

you can use PageRequest . Details can be found at Spring Data Elasticsearch

you can refer Example 2. PagingAndSortingRepository from doc

0
votes

Unfortunately, this feature is not available in spring data framework yet.

Link: https://jira.spring.io/browse/DATAES-187&usg=ALkJrhhjX4MjwaEWTnG5v-qucDQBlqVWXg