add query and search