public function applySearchOperator(Query $query, TokenInterface $token)
    {
        if (!$token->isOperator()) {
            return $query;
        }

        $callable = $this->_operatorCallable($token->name());
        if (is_callable($callable)) {
            $query = $callable($query, $token);
            if (!($query instanceof Query)) {
                throw new FatalErrorException(__d('search', 'Error while processing the "{0}" token in the search criteria.', $operator));
            }
        } else {
            $result = $this->_triggerOperator($query, $token);
            if ($result instanceof Query) {
                $query = $result;
            }
        }

        return $query;
    }