Rework the search API.