public boolean isRoot() {
        if (getParent()==null) return true;
        if (getParent() instanceof QueryTree) return true;
        return false;
    }
Returns true if this is the root item - that is if the parent is the QueryTree (or null for legacy reasons)
container-search/src/main/java/com/yahoo/prelude/query/Item.java