dachcom-digital/pimcore-dynamic-search-index-provider-lucene

SnowBallStemmingFilter uses not initialized locale

MiguelGomes3 opened this issue · 1 comments

Q A
Branch master,
Bug report? no
Feature request? yes
BC Break report? no
RFC? no

I implemented the bundle into my one-language project. When I trigger the search action, I get following error:
"Error while loading search output channel "search" for "default" context. Error was: Output Channel "search" Exception: Error while calling getResult() on output channel: Typed property DsLuceneBundle\Lucene\Filter\Stemming\SnowBallStemmingFilter::$locale must not be accessed before initialization[ ◀]()"

This happens due to locale not being initialized in the SnowballStemmingFilter:
protected string $locale;

Is this intended? Can't we assign an empty string as default for those who don't set locale?

@MiguelGomes3: The initialization is definitely a bug and has been fixed.

Locale: No, it is not possible to use a stemmer without any given locale. The SnowBallStemmingFilter is using the wamania/php-stemmer library, so a valid locale is mandatory. I've added en as a fallback locale, if no locale is available.