search function with string search support