I use scan and scroll to reindex from old_index to new_index. Right after the reindex completes, I do a refresh and flush, hoping that the data will persist into the disk. I then immediately read the document counts of both indices. The new index will usually have zero documents. I have to repeatedly read the document counts in a loop (with a 1-second pause in each iteration). Only after 20 seconds or so, I will see equal document counts. (The refresh rate of both indices were set to 30 seconds).
From my understanding, calling either refresh or flush, I should see the actual document counts. But it is not the case.