Implements search.