jolicode / elastically

🔍 JoliCode's Elastica wrapper to bootstrap Elasticsearch PHP integrations
248 stars 35 forks source link

setup misconfiguration #187

Open dealomuss opened 5 days ago

dealomuss commented 5 days ago

Hello,

thanks for this bundle ! sounds great

sadly i couldn't manage to set it up i have a "lot" of problem lately the newest error is
Mapping file "/company_mapping.yaml" not found. Please check y
our configuration.

i've followed the tutorial but it seems that my installation of symfony ( i'm using it in symfony ) is just completly ignoring the elastically.yml that i have created in config/packages/elastically.yml

i'm using php cli in docker env

PHP 8.2.20 (cli) (built: Jun 13 2024 02:30:07) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.20, Copyright (c) Zend Technologies

the elastically version installed is "jolicode/elastically": "^1.9",

i had enabled the bundle in bundles.php

return [
    Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
    JoliCode\Elastically\Bridge\Symfony\ElasticallyBundle::class => ['all' => true],

];

when i try to dump elastically config i've got an array to string error

I have no name!@3af6987d9cd3:/app$ bin/console config:dump elastically
# Default configuration for extension with alias: "elastically"
[critical] Error thrown while running command "'config:dump' elastically". Message: "Warning: Array to string conversion"

In YamlReferenceDumper.php line 132:

  Warning: Array to string conversion  

config:dump-reference [--format FORMAT] [--] [<name> [<path>]]

also i have to declare and re alias manually the services in my own services.yml with the following declaration

    elastically.default.client:
        class: JoliCode\Elastically\Client
    JoliCode\Elastically\Client: '@elastically.default.client'
    JoliCode\Elastically\IndexBuilder : '@elastically.default.index_builder'
    JoliCode\Elastically\Indexer: '@elastically.default.indexer'

i think i've missed something during installation because there are way too much problem here

anyhelp would be appreciated

here's my composer.json content

{
    "type": "project",
    "license": "proprietary",
    "minimum-stability": "stable",
    "prefer-stable": true,
    "require": {
        "php": ">=7.2.5",
        "ext-ctype": "*",
        "ext-iconv": "*",
        "jolicode/elastically": "^1.9",
        "ruflin/elastica": "*",
        "symfony/console": "5.4.*",
        "symfony/dotenv": "5.4.*",
        "symfony/flex": "^1.17|^2",
        "symfony/framework-bundle": "5.4.*",
        "symfony/runtime": "5.4.*",
        "symfony/yaml": "5.4.*"
    },
    "config": {
        "allow-plugins": {
            "composer/package-versions-deprecated": true,
            "php-http/discovery": true,
            "symfony/flex": true,
            "symfony/runtime": true
        },
        "optimize-autoloader": true,
        "preferred-install": {
            "*": "dist"
        },
        "sort-packages": true
    },
    "autoload": {
        "psr-4": {
            "App\\": "src/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "App\\Tests\\": "tests/"
        }
    },
    "replace": {
        "symfony/polyfill-ctype": "*",
        "symfony/polyfill-iconv": "*",
        "symfony/polyfill-php72": "*"
    },
    "scripts": {
        "auto-scripts": {
            "cache:clear": "symfony-cmd",
            "assets:install %PUBLIC_DIR%": "symfony-cmd"
        },
        "post-install-cmd": [
            "@auto-scripts"
        ],
        "post-update-cmd": [
            "@auto-scripts"
        ]
    },
    "conflict": {
        "symfony/symfony": "*"
    },
    "extra": {
        "symfony": {
            "allow-contrib": false,
            "require": "5.4.*"
        }
    }
}

thanks in advance

lyrixx commented 4 days ago

What PHP version are you using ? and what is the installed version of elastically?