search function apply