Use comparator for search.