Kunstmaan / KunstmaanBundlesCMS

An advanced yet user-friendly content management system, based on the full stack Symfony framework combined with a whole host of community bundles. It provides a full featured, multi-language CMS system with an innovative page and form assembling process, versioning, workflow, translation and media managers and much more.
https://kunstmaancms.be
MIT License
406 stars 188 forks source link

[SearchBundle] Misleading documentation #3364

Open tentwofour opened 7 months ago

tentwofour commented 7 months ago

Within the SearchBundles' services.yml, it's stated to override the kunstmaan_search.search.factory.analysis.class parameter, to change from the default LanguageAnalysisFactory to the NGramAnalysisFactory, but the service definition uses a hardcoded class, instead of a parameter:

https://github.com/Kunstmaan/KunstmaanBundlesCMS/blob/16b52b19362ae579ad22729bbcf3c205ddf04d35/src/Kunstmaan/SearchBundle/Resources/config/services.yml#L1-L18

And referenced the same way in the doc:

https://github.com/Kunstmaan/KunstmaanBundlesCMS/blob/16b52b19362ae579ad22729bbcf3c205ddf04d35/src/Kunstmaan/SearchBundle/Resources/doc/SearchBundle.md?plain=1#L8-L32

I overrode the definition in my project with no issues (after deleting/rebuilding the indices)

kunstmaan_search.search.factory.analysis:
        class: Kunstmaan\SearchBundle\Search\NGramAnalysisFactory
        public: true

And have also modified the services.yml file noted above by defining a parameter, also with no adverse results (ie. aligns to what the docs say)

parameters:
    kunstmaan_search.search_provider: 'Elastica'
    kunstmaan_search.search.factory.analysis.class: Kunstmaan\SearchBundle\Search\NGramAnalysisFactory

services:
    kunstmaan_search.search.factory.analysis:
        class: '%kunstmaan_search.search.factory.analysis.class%'
        public: true

I'm unsure of why it got hardcoded in 9e7917d; it was a parameter in eebd820