Avoid running out of memory and clear object cache between pages in _index_helper WP-CLI

Experiencing fatal out of memory messages, thought this would be a useful addition. Kept dying at about 11k posts, now able to consume all 21201 posts.