implement the search in the index