Prepared script to run indexing