Allow defaultSearchTerm to be a function as well as a string.