updated GroupBy: append "^" only when __encoded_query is already set