Script for indexing