简体   繁体   中英

Is it possible to use ongr-elasticsearch bundle without AppBundle in Symfony 4?

I'm in the process of upgrading a project from Symfony 2 to Symfony 4. As per the recommendation from Symfony, I no longer use AppBundle, instead all the code is directly under src/.

My question is how should I configure the manager when I'm no longer using AppBundle, if it is possible? I'm using latest stable version 5.2.4 of ongr-elasticsearch.

My config is below. In the mappings section I need to put a bundle name. Is there some way to get around this?

ongr_elasticsearch:
    managers:
        default:
            index:
                hosts:
                    - "%elasticsearch_host%:%elasticsearch_port%"
                index_name: "%database_name%"
            mappings:
                - AppBundle
            bulk_size: 300

It's not possible to use v5 without bundles, but the 6th version has support for it as well as for Symfony flex. At the moment of writing, this version is in beta2 and no major issues were found so should be released stable very soon.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM