Generic method for search is done.