我正在尝试让 FOSElasticaBundle 工作。ElasticSearch 实例在 localhost:9200 上运行并响应。
我按照文档中的每个步骤https://github.com/FriendsOfSymfony/FOSElasticaBundle/blob/master/Resources/doc/setup.md
但在最后一步,我在控制台中收到此错误:
c:\xampp\htdocs\my\folder>php app/console fos:elastica:populate
Resetting app
Fatal error: Wrong parameters for Exception([string $exception [, long $code [,
Exception $previous = NULL]]]) in C:\xampp\htdocs\my\folder\vendor\rufli
n\elastica\lib\Elastica\Exception\ResponseException.php on line 34
[Symfony\Component\Debug\Exception\FatalErrorException]
Error: Wrong parameters for Exception([string $exception [, long $code [, Exception $previous = NULL]]])
fos:elastica:populate [--index[="..."]] [--type[="..."]] [--no-reset] [--offset="..."] [--sleep="..."] [--batch-size="..."] [--ignore-errors] [--no-overwrite-format]
似乎“__construct”-Function 必须有 3 个参数,但其中只有 2 个。我只是尝试添加“NULL”参数以使其工作,但随后另一个函数引发错误。
public function __construct(Request $request, Response $response)
{
$this->_request = $request;
$this->_response = $response;
parent::__construct($response->getError());
}
这是个常见的问题吗?我该如何解决?