refs #1211, avoids separate db call for pagination

Besides, pagination numbers and content are now in sync even if elasticsearch didn't finish its indexing.