2016-10-22 86 views
0


我正在嘗試設置FOSElasticaBundle。
作曲JSON條目:Symfony3 FOSElasticaBundle文檔示例不起作用

"friendsofsymfony/elastica-bundle": "^3.2" 

我下面的官方docs教程,
但此行不工作:

$finder = $this->container->get('fos_elastica.finder.app.user'); 

錯誤,我得到:

你已要求不存在的服務「fos_elastica.index.app.user」。

你知道爲什麼嗎?

事情,我檢查:

  • AppKernel.php包含'新FOS \ ElasticaBundle \ FOSElasticaBundle(),'
  • 探查下的 '配置' 選項卡上不顯示 'FOSElastica' 爲有效: (

config.yml:

fos_elastica: 
    clients: 
     default: { host: localhost, port: 9200 } 
    indexes: 
     app: 
      types: 
       user: 
        mappings: 
         email: ~ 
        persistence: 
         # the driver can be orm, mongodb, phpcr or propel 
         # listener and finder are not supported by 
         # propel and should be removed 
         driver: orm 
         model: AppBundle\Entity\User 
         provider: ~ 
         listener: ~ 
         finder: ~ 

預先感謝任何見解,你們:)

回答

0

原來束沒有正確安裝。

"minimum-stability": "dev", 

在全新安裝composer.json工作