Make it possible to use a function for the search param.