refactor Collection::search and ::searchData