This function takes the following parameters:
Function to call to rewrite a filter for the search
Function to call to cleanup after performing the rewritten search