merge and search