gpt4 book ai didi

symfony - FOSElasticaBundle上的未定义索引

转载 作者:行者123 更新时间:2023-12-02 23:37:01 25 4
gpt4 key购买 nike

我在Symfony2上安装了FOSElasticaBundle,以查找有关elasticsearch的数据。我遵循了说明,但是我有一个错误,并且我不知道如何处理。错误如下:

Notice: Undefined index: bluecoat-syslog

500 Internal Server Error - ContextErrorException


堆栈跟踪
in vendor/friendsofsymfony/elastica-bundle/Transformer/ElasticaToModelTransformerCollection.php at line 56   -
$transformed = array();
foreach ($sorted as $type => $objects) {
* $transformedObjects = $this->transformers[$type]->transform($objects);
$identifierGetter = 'get'.ucfirst($this->transformers[$type]->getIdentifierField());
$transformed[$type] = array_combine(
array_map(
我的 Controller
public function reportAction(Request $request)
{
$finder = $this->container->get('fos_elastica.finder.log');

$results = $finder->find('ERROR');

$parameters = array("results" => $results);

return $this->render('MyBundle:Core:report.html.twig', $parameters);
}
我的config.yml
fos_elastica:
clients:
default: { host: localhost, port: 9200 }
indexes:
log:
client: default
index_name: log-2015.04.20
finder: ~
types:
bluecoat-syslog:
mappings:
message: ~
bundle 软件的版本为:
FOSElasticaBundle 3.1.x
谢谢,谢谢!

最佳答案

  • 通过不带-的内容更改索引名称
  • 不要忘记使用以下命令创建索引php app/console fos:elastica:populate
  • 关于symfony - FOSElasticaBundle上的未定义索引,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29753486/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com