Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring data elasticsearch wrong page totalPages

I have a simple repository

@Repository
public interface SurgeryIndexRepository extends ElasticsearchRepository<SurgeryIndexEntity, UUID> {}

When I call the search method like this surgeryIndexRepository.search(query, pageable) I get a Page response with totalPages = 1, numberOfElements=40, totalElements=7200. Something is wrong with the totalPages, I should have 180.

My Pageable is Page request [number: 0, size 40, sort: date: DESC]

I'm using Maven: org.springframework.data:spring-data-elasticsearch:3.0.6.RELEASE

like image 655
Maelig Avatar asked Oct 16 '22 15:10

Maelig


1 Answers

This problem has been resolved in 3.0.7 : https://jira.spring.io/browse/DATAES-402, we were using 3.0.6, so just upgraded to current release version 3.0.8.RELEASE and it solved the problem.

Another reference to this problem : elasticsearch: return TotalPages not correct

like image 129
Maelig Avatar answered Oct 20 '22 21:10

Maelig