Flush before reindexing in the rotation script