public static String canonicalize(Query query) {
        return canonicalize(query.getModel().getQueryTree(),
                            query.properties().getInteger(DefaultProperties.MAX_QUERY_ITEMS));
    }
Validates this query and carries out possible operations on this query
which simplifies it without changing its semantics.

@return null if the query is valid, an error message if it is invalid
container-search/src/main/java/com/yahoo/prelude/query/QueryCanonicalizer.java