improve Query::search method