added error handling to search indexing script