protected function addBool(array $query, $bool, $filter = false, array $params = []) {
        $filtered = $filter ? "filter" : "query";
        $key = "query.filtered.{$filtered}.bool.{$bool}";
        if ($filter) {
            $this->assertInitiated($key);
        }
        $this->query["query"]["filtered"][$filtered]["bool"][$bool][] = array_merge_recursive($query, $params);
    }