Adding failing tests which exposes the bug when new index is created and the optimization is applied for it
Fixing the optimization when new index is created. We need to retrieve all documents not just the first 128 results.
Merge pull request #1334 from arekais/fixing-new-index-optimization

Fixing new index optimization