Better deal with invalid scroll ids.

Closes #5738
[TEST] Reduce the amount of docs being indexed.