search function in index file