update search function for index pages