Make search query to be executed dynamic