Currently I use hibernate search api enabling search pagination as
jpaQuery.setFirstResult((pageNumber - 1) * pageSize).setMaxResults(pageSize).getResultList();
Now I just want to know how many results in total, or how many pages in total in advance without querying for a second time like
Because that is not ideal and not necessarily to hit the ES second time.
Any one could help?