@Override
    public boolean equals(Object o) {
        if ( ! (o instanceof Model other)) return false;

        if ( ! (
                QueryHelper.equals(other.encoding, this.encoding) &&
                QueryHelper.equals(other.language, this.language) &&
                QueryHelper.equals(other.searchPath, this.searchPath) &&
                QueryHelper.equals(other.sources, this.sources) &&
                QueryHelper.equals(other.restrict, this.restrict) &&
                QueryHelper.equals(other.defaultIndex, this.defaultIndex) &&
                QueryHelper.equals(other.type, this.type) ))
            return false;

        if (other.queryTree == null && this.queryTree == null) // don't cause query parsing
            return QueryHelper.equals(other.queryString, this.queryString) &&
                   QueryHelper.equals(other.filter, this.filter);
        else // make sure we compare a parsed variant of both
            return QueryHelper.equals(other.getQueryTree(), this.getQueryTree());
    }
Sets the query type of this query.
The type is taken into account at the time the query tree is parsed.
Setting this does <i>not</i> cause the query to be reparsed.
container-search/src/main/java/com/yahoo/search/query/Model.java