add search function

添加搜索功能
we can try to refactor the long method together tomorrow.