input search and tag search function