douba9425 2018-12-03 12:10 采纳率: 100%
浏览 41

Symfony 3.2 FOSElasticSearch 5.x

I'm trying to install FOSElasticSearch bundle (using composer) into Symfony 3.2

This is my composer.json file content:

{
"name": "CompanyName/standard-edition",
"license": "MIT",
"type": "project",
"description": "The \"Symfony Standard Edition\" ",
"minimum-stability": "stable",
"autoload": {
    "psr-4": {
        "": "src/"
    },
    "classmap": ["app/AppKernel.php", "app/AppCache.php"]
},
"autoload-dev": {
    "psr-4": {
        "Tests\\": "tests/"
    },
    "files": ["vendor/symfony/symfony/src/Symfony/Component/VarDumper/Resources/functions/dump.php"]
},
"require": {
    "php": ">=7.1.0",
    "beberlei/DoctrineExtensions": "^1.0@dev",
    "dflydev/apache-mime-types": "1.*",
    "doctrine/doctrine-bundle": "^1.6",
    "doctrine/doctrine-cache-bundle": "^1.2",
    "doctrine/doctrine-migrations-bundle": "^1.2",
    "doctrine/orm": "^2.5",
    "egeloen/google-map-bundle": "^3.0@dev",
    "friendsofsymfony/jsrouting-bundle": "^2.2",
    "friendsofsymfony/elastica-bundle": "5.*",
    "hwi/oauth-bundle": "0.5.*",
    "incenteev/composer-parameter-handler": "^2.0",
    "knplabs/knp-menu-bundle": "~2",
    "leafo/scssphp": "v0.6.3",
    "php-http/guzzle6-adapter": "^1.1",
    "php-http/httplug-bundle": "^1.1",
    "phpoffice/phpword": "^0.13",
    "pulse00/monolog-parser": "*",
    "rashid2538/php-htmldiff": "dev-master",
    "requestlab/vimeo-bundle": "dev-master",
    "sensio/distribution-bundle": "^5.0",
    "sonata-project/classification-bundle": "^3.2",
    "sonata-project/media-bundle": "^3.2",
    "sp/bower-bundle": "dev-master#0163011a6f46e077556653dd32d6b659375bad8c",
    "symfony/assetic-bundle": "~2.3",
    "symfony/cache": "3.2.*",
    "symfony/framework-bundle": "~2.8|~3.0|~3.1|~3.2",
    "symfony/monolog-bundle": "^3.0.2",
    "symfony/swiftmailer-bundle": "^2.3.10",
    "symfony/symfony": "3.2.*",
    "twig/extensions": "^1.3"
},
"require-dev": {
    "sensio/generator-bundle": "^3.0",
    "symfony/phpunit-bridge": "^3.0",
    "symfony/var-dumper": "3.2.*"
},
"scripts": {
    "symfony-scripts": [
        "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget"
    ],
    "post-install-cmd": [
        "@symfony-scripts",
        "Sp\\BowerBundle\\Composer\\ScriptHandler::bowerInstall"
    ],
    "post-update-cmd": [
        "@symfony-scripts",
        "Sp\\BowerBundle\\Composer\\ScriptHandler::bowerUpdate"
    ]
},
"config": {
    "platform": {
        "php": "7.2.0"
    },
    "sort-packages": true
},
"extra": {
    "symfony-app-dir": "app",
    "symfony-bin-dir": "bin",
    "symfony-var-dir": "var",
    "symfony-web-dir": "web",
    "symfony-tests-dir": "tests",
    "incenteev-parameters": {
        "file": "app/config/parameters.yml"
    },
    "branch-alias": {
        "dev-master": "3.2-dev"
    }
}

When i change this line in composer.json file to install latest version

"friendsofsymfony/elastica-bundle": "5.*",

i get this error https://pastebin.com/CaYJYdFB

to

 "friendsofsymfony/elastica-bundle": "*",

then i get FOSElasticBundle version 4.1.2, but the problem with this version is when i try to populate it using

php bin/console fos:elastic:populate

i get this error

Content-Type header [application/x-www-form-urlencoded] is not supported 

People with same problem recommend upgrading to FosElasticBundle version 5.*.

fos_elastica:

clients: default: { host: localhost, port: 9200 } indexes: app: types: item: mappings: title: ~ author: ~ categories: ~ description: ~ tags: ~ location: ~

      persistence:
        driver: orm
        model: EBMB\BaseBundle\MediaItem\Model\Item
        provider: ~
        listener: ~
        finder: ~

Here is also my Elasticsearch configuration in config.yml

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
    • ¥15 关于#hadoop#的问题
    • ¥15 (标签-Python|关键词-socket)
    • ¥15 keil里为什么main.c定义的函数在it.c调用不了
    • ¥50 切换TabTip键盘的输入法
    • ¥15 可否在不同线程中调用封装数据库操作的类
    • ¥15 微带串馈天线阵列每个阵元宽度计算
    • ¥15 keil的map文件中Image component sizes各项意思
    • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
    • ¥15 划分vlan后,链路不通了?