Skip to content

Instantly share code, notes, and snippets.

View vladdnepr's full-sized avatar

Vladislav Lyshenko vladdnepr

View GitHub Profile
@vladdnepr
vladdnepr / ElasticaAsyncSubscriber.php
Created April 15, 2023 11:38
Solution For Index Aliases in FOS Elastica Bundle With Symfony Messenger. Required Symfony 6.2+
<?php
namespace App\Subscriber;
use FOS\ElasticaBundle\Elastica\Index;
use FOS\ElasticaBundle\Event\PostIndexPopulateEvent;
use FOS\ElasticaBundle\Event\PreIndexPopulateEvent;
use FOS\ElasticaBundle\Index\IndexManager;
use FOS\ElasticaBundle\Index\Resetter;
use FOS\ElasticaBundle\Message\AsyncPersistPage;