Algolia does not allows to negate a group
@see https://www.algolia.com/doc/api-client/php/parameters#filters

@throws \InvalidArgumentException
10287
private function validate(Specification $spec)
    {
        if ($spec instanceof Not || $spec instanceof AndX || $spec instanceof OrX) {
            throw new \InvalidArgumentException('Algolia does not allows to negate a group');
        }
    }
595253
protected function filters()
    {
        $where = $this->initFilters();

        $gf = $this->globalFilter();
        $where .= (empty($where) ? $gf : (empty($gf) ? '' : ' AND '.$gf));

        $gf = $this->individualColumnFilters();
        $where .= (empty($where) ? $gf : (empty($gf) ? '' : ' AND '.$gf));

        return $where;
    }
967316
public function setAutoFilter($filteredColumnName, $filteredValue)
    {
        if (!is_string($filteredColumnName)) {
            throw new InvalidArgumentException('setAutoFilter only accepts string as argument.');
        }
        if (!isset($filteredColumnName)) {
            throw new InvalidArgumentException('filteredValue must be set.');
        }
        $this->filteredColumnName = $filteredColumnName;
        $this->filteredValue = $filteredValue;
        return $this;
    }
580478
public function setDefaultFilter($name)
    {
        if (!\array_key_exists($name, $this->filters)) {
            throw new \InvalidArgumentException(sprintf('Cannot set default exception filter "%s". It does not exist.', $name));
        }

        $this->defaultFilter = $name;
    }
949818
public GroupFilter where(Predicate<GroupMetadata> filter) {
        checkNotNull(filter, "Filter predicate must be not a null");

        this.predicate = this.predicate.and(filter);

        return this;
    }
821814
public function group($group = null) {
		if (is_null($group))
			return $this->discard('query.group');
	
		if ($group instanceof Column) {
			//get referred attribute
			$map = $this->entityProfile->getPropertyMap();
			if (!in_array($group->getName(), $map))
				throw new \InvalidArgumentException(sprintf("Column '%s' is unknown for class '%s'", $group->getName(), $this->entityProfile->getReflectionClass()->getName()));
			$name = array_flip($map)[$group->getName()];
		}
		elseif ($group instanceof Attr)
			$name = $group->getName();
		elseif (is_string($group))
			$name = $group;
		else
			throw new \InvalidArgumentException("Group must be specified through an Attr instance or a valid property name");
		
		//get custom type (if any)
		$type = $group->getType();
		if (isset($type))
			return $this->merge(['query.group' => $group->getName() . ':' . $type]);
		return $this->merge(['query.group' => $group->getName()]);
	}
1125803
private function processFilterDefinition()
    {
        if (isset($this->definition['filter'])) {
            
            if (is_array($this->definition['filter'])) {
                
                if (! count($this->definition['filter']) == 2) {
                    Throw new QueryBuilderException('Querybuilder needs two elements when filter is set as array. The first element has to be the filter statement. The second one an assoc array with filter parameters');
                }
                
                $array = new IsAssoc($this->definition['filter'][1]);
                
                if (! $array->isAssoc()) {
                    Throw new QueryBuilderException('Querybuilder needs an assoc array as filter parameter list.');
                }
                
                $this->filter = $this->definition['filter'][0];
                
                // Set params
                $this->setParameter($this->definition['filter'][1]);
            } else {
                $this->filter = $this->definition['filter'];
            }
        }
    }
36641
private function isFilterable($filter)
    {
        if (is_string($filter) && ! class_exists($filter)) {
            throw new Exceptions\InvalidFilterException(
                "The [$filter] class does not exits."
            );
        }

        if ( ! in_array(Filterable::class, class_implements($filter))) {
            throw new Exceptions\InvalidFilterException(
                'The filter must be a Closure or a class implementing the Filterable interface.'
            );
        }
    }
356401
protected function validateFilter($filter)
    {
        if (!isset($this->filterOptions->getFilters()[$filter])) {
            throw new Exception\FilterNotFoundException(sprintf(
                'Filter "%s" was not found', $filter
            ));
        }
        $options = $this->filterOptions->getFilters()[$filter];
        if (!isset($options['type'])) {
            throw new Exception\InvalidArgumentException(sprintf(
                'Filter type for "%s" image filter must be specified', $filter
            ));
        }
        if (!isset($options['options'])) {
            throw new Exception\InvalidArgumentException(sprintf(
                'Options for filter type "%s" must be specified', $filter
            ));
        }
    }
493682
public function sanitizeEventFilter($filters)
    {
        if (!is_array($filters)) {
            throw new \InvalidArgumentException('filters parameter must be an array');
        }

        if (!isset($filters['search'])) {
            $filters['search'] = '';
        }

        if (!isset($filters['includeEvents'])) {
            $filters['includeEvents'] = [];
        }

        if (!isset($filters['excludeEvents'])) {
            $filters['excludeEvents'] = [];
        }

        return $filters;
    }
25270
public function setMacroTemplateGroupFilter($filter, $macroTemplate = null)
    {
        if(!isset($this->groupFilters[$filter])){
            throw new \RuntimeException(sprintf("The group filter %s is not added.", $filter));
        }

        $groupFilter = $this->groupFilters[$filter];
        $groupFilter->setMacroTemplate($macroTemplate);
    }
538440
private function protect()
    {
        if (!in_array($this->type, self::allAsString(), true)) {
            throw new \InvalidArgumentException(sprintf('Invalid token type "%s"', $this->type));
        }
    }
11945
protected function getFilter() {
		$filter = $this->getOption('query.filter');
		$negate = false;
		if ($this->hasOption('query.negate'))
			$negate = (bool) $this->getOption('query.negate');
		if (is_array($filter))
			return new Filter($filter, $negate);
		return new Filter([$filter], $negate);
	}
1368110
private function addFilter($filter)
    {
        if (is_array($filter)) {
            if (!isset($filter['method'])) {
                throw new \InvalidArgumentException(
                    'A [method] value must be specified for each complex filter'
                );
            }
        }

        if (!$this->filters) {
            $this->filters = [$filter];
        } else {
            $this->filters[] = $filter;
        }

        return $this;
    }
638376
protected function validateFilters()
  {
    if (!empty($this->value) && !empty($this->filters)) {
      foreach ($this->filters as $filter) {
        if (is_array($this->value) && $this->isMultipleChoiceAllowed()) {
          $this->value = Filter::Arr($this->value, $filter, null);

          $bad = empty($this->value);
        } else {
          $bad = is_null(Filter::Value($this->value, $filter, null));
        }

        if ($bad) {
          $this->addError(sprintf($this->tmpl_err_wrong, $this->getName()));

          return false;
        }
      }
    }

    return true;
  }
775186
protected function filtering()
    {
        $app = Yii::$app;
        if ($this->statusCode) {
            if (is_integer($this->statusCode)) {
                if ($app->getRequest()->getIsAjax()) {
                    $app->getResponse()->setStatusCode(self::STATUS_CODE_OK);
                } else {
                    $app->getResponse()->setStatusCode($this->statusCode);
                    if ($this->retryAfter){
                        $app->getResponse()->getHeaders()->set('Retry-After', $this->retryAfter);
                    }
                }
            } else {
                throw new InvalidConfigException('Parameter "statusCode" should be an integer.');
            }
        }
        // Check users
        if ($this->users) {
            if (is_array($this->users)) {
                $this->disable = $app->getUser()->getIdentity()
                    ? in_array($app->getUser()->getIdentity()->{$this->usernameAttribute}, $this->users)
                    : false;
            } elseif (is_string($this->users)) {
                $this->disable = $app->getUser()->getIdentity()->{$this->usernameAttribute} === $this->users;
            } else {
                throw new InvalidConfigException('Parameter "users" should be an array or string.');
            }
        }
        // Check roles
        if ($this->roles) {
            if (is_array($this->roles)) {
                foreach ($this->roles as $role) {
                    $this->disable = $this->disable || $app->getUser()->can($role);
                }
            } else {
                throw new InvalidConfigException('Parameter "roles" should be an array.');
            }
        }
        // Check URL's
        if ($this->urls) {
            if (is_array($this->urls)) {
                $this->disable = $this->disable || in_array($app->getRequest()->getPathInfo(), $this->urls);
            } else {
                throw new InvalidConfigException('Parameter "urls" should be an array.');
            }
        }
        // Check IP's
        if ($this->ips) {
            if (is_array($this->ips)) {
                foreach ($this->ips as $filter) {
                    $this->disable = $this->disable || $this->checkIp($filter);
                }
            } elseif (is_string($this->ips)){
                $this->disable = $this->disable || $this->checkIp($this->ips);
            } else {
                throw new InvalidConfigException('Parameter "ips" should be an array.');
            }
        }
        if (!$this->disable) {
            if ($this->route === 'maintenance/index') {
                $app->controllerMap['maintenance'] = 'brussens\maintenance\controllers\MaintenanceController';
            }
            $app->catchAll = [$this->route];
        } else {
            $app->getResponse()->setStatusCode(self::STATUS_CODE_OK);
        }
    }
293731
protected function validateFilters(/** @noinspection PhpUnusedParameterInspection */
        &$document_data, &$data, array $data_pointer, array $parent_data_pointer, ISchema $document, $schema, ValidationResult $bag): bool
    {
        if (!property_exists($schema, Schema::FILTERS_PROP) || !$this->filters) {
            return true;
        }

        /** @var array $filters */
        $filters = null;
        if (is_string($schema->{Schema::FILTERS_PROP})) {
            $filters = [(object)[Schema::FUNC_NAME => $schema->{Schema::FILTERS_PROP}]];
        }
        elseif (is_object($schema->{Schema::FILTERS_PROP})) {
            $filters = [$schema->{Schema::FILTERS_PROP}];
        } elseif (is_array($schema->{Schema::FILTERS_PROP})) {
            $filters = $schema->{Schema::FILTERS_PROP};
            if (count($filters) === 0) {
                return true;
            }
            foreach ($filters as &$filter) {
                if (is_string($filter)) {
                    $filter = (object)[Schema::FUNC_NAME => $filter];
                }
            }
            unset($filter);
        } else {
            throw new SchemaKeywordException(
                $schema,
                Schema::FILTERS_PROP,
                $schema->{Schema::FILTERS_PROP},
                "'" . Schema::FILTERS_PROP . "' keyword must be a string, an object or an array of objects, " . gettype($schema->{Schema::FILTERS_PROP}) . " given"
            );
        }

        $type = $this->helper->type($data, true);
        $filter_name = null;
        $valid = true;
        foreach ($filters as $filter) {
            if (!is_object($filter)) {
                throw new SchemaKeywordException(
                    $schema,
                    Schema::FILTERS_PROP,
                    $schema->{Schema::FILTERS_PROP},
                    "'" . Schema::FILTERS_PROP . "' keyword must be a string, an object or an array of objects, found " . gettype($filter)
                );
            }
            if (!property_exists($filter, Schema::FUNC_NAME)) {
                throw new SchemaKeywordException(
                    $filter,
                    Schema::FUNC_NAME,
                    null,
                    "'" . Schema::FUNC_NAME . "' keyword is required"
                );
            }
            if (!is_string($filter->{Schema::FUNC_NAME})) {
                throw new SchemaKeywordException(
                    $filter,
                    Schema::FUNC_NAME,
                    $filter->{Schema::FUNC_NAME},
                    "'" . Schema::FUNC_NAME . "' keyword must be a string, " . gettype($filter->{Schema::FUNC_NAME}) . " given"
                );
            }

            $filterObj = $this->filters->get($type, $filter->{Schema::FUNC_NAME});
            if ($filterObj === null) {
                if ($type === 'integer') {
                    $filterObj = $this->filters->get('number', $filter->{Schema::FUNC_NAME});
                    if ($filterObj === null) {
                        throw new FilterNotFoundException($type, $filter->{Schema::FUNC_NAME});
                    }
                } else {
                    throw new FilterNotFoundException($type, $filter->{Schema::FUNC_NAME});
                }
            }

            if (property_exists($filter, Schema::VARS_PROP)) {
                if (!is_object($filter->{Schema::VARS_PROP})) {
                    throw new SchemaKeywordException(
                        $filter,
                        Schema::VARS_PROP,
                        $filter->{Schema::VARS_PROP},
                        "'" . Schema::VARS_PROP . "' keyword must be an object, " . gettype($filter->{Schema::VARS_PROP}) . " given"
                    );
                }
                $vars = $this->deepClone($filter->{Schema::VARS_PROP});
                $this->resolveVars($vars, $document_data, $data_pointer);
                $vars = (array)$vars;
                if ($this->globalVars) {
                    $vars += $this->globalVars;
                }
            } else {
                $vars = $this->globalVars;
            }

            if (!$filterObj->validate($data, $vars)) {
                $valid = false;
                $filter_name = $filter->{Schema::FUNC_NAME};
                break;
            }

            unset($vars, $filterObj);
        }

        if (!$valid) {
            $bag->addError(new ValidationError($data, $data_pointer, $parent_data_pointer, $schema, Schema::FILTERS_PROP, [
                'type' => $type,
                'filter' => $filter_name,
            ]));
            return false;
        }

        return true;
    }