This is caused by browsing an index that is being modified or re-indexed at the same time.
Browsing an index uses a cursor. It’s an iterator on the records of an index, and used to get the next batch of records. Indices modifications may invalidate the cursor, because some records were removed or the index internal structure (like the number of shards) was modified for example.