Result of hits.getLength() while using pagination is wrong.
Reported value is always limited to page size * 2, only when real value stays into this range it is reported.
As an example, by using a page size of 1 (start = 0, end = 1), reported length is 3. When asking for page 2 (start=1, end=2) length jumps to 5, and so on until we get close to real value.
This behaviour makes search pagination unusable, because result size is wrong and this leads to OutOfBoundExceptions on page jumping.