added option to set search.ajax to a function