Nice solution here! It doesn't need a cron job to create indices, and it doesn't make 2 requests all the time.