SuluArticleBundle抛出未定义索引:文章

SuluArticleBundle抛出未定义索引:文章

问题描述:

我试图用ElasticSearch 2.4设置SuluArticleBundle。我正在关注的documentation但在运行php bin/console assets:install命令SuluArticleBundle抛出未定义索引:文章

这是我第一次使用ElasticSearch和SuluArticleBundle,所以我不知道这是否是一个时,我不断收到

[Symfony\Component\Debug\Exception\ContextErrorException] Notice: Undefined index: article

与我的ElasticSearch设置或软件包设置有关的错误。

任何想法可能是什么问题?

编辑

这是堆栈跟踪

Exception trace: () at /Users/jaimy/projects/student-starter/vendor/sulu/article-bundle/DependencyInjection/SuluArticleExtension.php:253 Sulu\Bundle\ArticleBundle\DependencyInjection\SuluArticleExtension->appendArticlePageConfig() at /Users/jaimy/projects/student-starter/vendor/sulu/article-bundle/DependencyInjection/SuluArticleExtension.php:207 Sulu\Bundle\ArticleBundle\DependencyInjection\SuluArticleExtension->load() at /Users/jaimy/projects/student-starter/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/MergeExtensionConfigurationPass.php:66 Symfony\Component\DependencyInjection\Compiler\MergeExtensionConfigurationPass->process() at /Users/jaimy/projects/student-starter/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/DependencyInjection/MergeExtensionConfigurationPass.php:39 Symfony\Component\HttpKernel\DependencyInjection\MergeExtensionConfigurationPass->process() at /Users/jaimy/projects/student-starter/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/Compiler.php:143 Symfony\Component\DependencyInjection\Compiler\Compiler->compile() at /Users/jaimy/projects/student-starter/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerBuilder.php:746 Symfony\Component\DependencyInjection\ContainerBuilder->compile() at /Users/jaimy/projects/student-starter/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:576 Symfony\Component\HttpKernel\Kernel->initializeContainer() at /Users/jaimy/projects/student-starter/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:118 Symfony\Component\HttpKernel\Kernel->boot() at /Users/jaimy/projects/student-starter/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:65 Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /Users/jaimy/projects/student-starter/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:125 Symfony\Component\Console\Application->run() at /Users/jaimy/projects/student-starter/bin/console.php:23 include() at /Users/jaimy/projects/student-starter/bin/console:21 编辑#2

这是我sulu_core配置

# SuluCore Configuration 
sulu_core: 
    webspace: 
     config_dir: "%kernel.root_dir%/Resources/webspaces" 
    content: 
     structure: 
      default_type: 
       snippet: "article_default" 
      paths: 
       homepage: 
        path: "%kernel.root_dir%/Resources/templates/pages" 
        type: "home" 
       page: 
        path: "%kernel.root_dir%/Resources/templates/pages" 
        type: "page" 
       snippet: 
        path: "%kernel.root_dir%/Resources/templates/snippets" 
        type: "snippet" 
       article: 
        path: "%kernel.root_dir%/Resources/templates/articles" 
        type: "article" 
+0

你能用'-v'标志调用该命令并发布堆栈跟踪吗?然后我可以看到哪一行导致问题!你用过最新版本的SuluArticleBundle吗? –

+0

你还配置了新的路径'sulu_core'吗?请参阅:https://github.com/sulu/SuluArticleBundle/blob/master/Resources/doc/installation.md#configure-suluarticlebundle-and-sulu-core –

+0

我已将堆栈跟踪添加到问题。是的,我使用的是最新版本的ArticleBundle。 我还没有配置'sulu_core'。可能解决我的问题?我还没有这样做,因为我正在按顺序浏览安装文档。 – Jaimy

我想你错过的default_t的文章的ype配置。请在sulu_core.content.structure.default_type.article上添加配置。

+0

非常感谢您的时间和帮助!这是问题所在。愚蠢的错误。再次感谢! – Jaimy