Skip to content

Commit

Permalink
replaced Integer.MAX_VALUE from findAll(Sort sort) with actual count
Browse files Browse the repository at this point in the history
  • Loading branch information
Rizwan Idrees committed Mar 20, 2013
1 parent 9232739 commit e9eed44
Showing 1 changed file with 5 additions and 1 deletion.
Expand Up @@ -95,9 +95,13 @@ public Page<T> findAll(Pageable pageable) {

@Override
public Iterable<T> findAll(Sort sort) {
int itemCount = (int) this.count();
if (itemCount == 0) {
return new PageImpl<T>(Collections.<T> emptyList());
}
SearchQuery query = new SearchQuery();
query.setElasticsearchQuery(matchAllQuery());
query.setPageable(new PageRequest(0,Integer.MAX_VALUE, sort));
query.setPageable(new PageRequest(0,itemCount, sort));
return elasticsearchOperations.queryForPage(query, getEntityClass());
}

Expand Down

0 comments on commit e9eed44

Please sign in to comment.