You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I scratched my head around why my search isn't filtered by locale. I'm using DoctrineExtensions Translatable extension and I made a custom reindex provider because I see this is used in ReindexCommand to extract translations for each object.
Well, I didn't expect that calling $this->searchManager->index($object, $locale); ignores $locale because index() method takes only one argument. So, this entire block of code is in fact useless:
I think the entire thing with creating custom providers is useful but now it's too tightly coupled with the entity structure. It has to contain its locale somewhere which is exactly how DoctrineExtensions Translatable extension doesn't work. The LocalizedReindexProviderInterface could work for me when reindexing even though I'd appreciate if providers could check whether they support particular entity class.
Maybe If I could use the same LocalizedReindexProviderInterface provider in IndexListener to grab all translations for particular entity and index them instead of relying on locale property? That would help me a lot.
The text was updated successfully, but these errors were encountered:
I scratched my head around why my search isn't filtered by locale. I'm using DoctrineExtensions Translatable extension and I made a custom reindex provider because I see this is used in
ReindexCommand
to extract translations for each object.Well, I didn't expect that calling
$this->searchManager->index($object, $locale);
ignores$locale
becauseindex()
method takes only one argument. So, this entire block of code is in fact useless:This all has no effect on entitie's indexed locale because real locale is always extracted from the entity in
ObjectToDocumentConverter
.I actually ended up using deprecated call to entity repository that returns all objects that I need to index even though it's probably supposed to throw an error with
trigger_error()
which is silenced with@
so I doesn't.I think the entire thing with creating custom providers is useful but now it's too tightly coupled with the entity structure. It has to contain its locale somewhere which is exactly how DoctrineExtensions Translatable extension doesn't work. The
LocalizedReindexProviderInterface
could work for me when reindexing even though I'd appreciate if providers could check whether they support particular entity class.Maybe If I could use the same
LocalizedReindexProviderInterface
provider inIndexListener
to grab all translations for particular entity and index them instead of relying onlocale
property? That would help me a lot.The text was updated successfully, but these errors were encountered: