I\'m using FOSElasticaBundle and Doctrine in my project, and my code works for the selective index update using the Doctrine lifecycle events. The issue I come up against is
with all comments and my research, I made a generic Gist for auto index child objects with fosElastica:
https://gist.github.com/Nightbr/ddb586394d95877dde8ed7445c51d973
In fact, I override the default Listener from FOSElastica and I add the function updateRelations($entity). We will search all relations linked to the $entity and if there are indexed in ES (the ES type exists) it will update the related documents.
If anyone want to look at it and make any improvement it would be great! ^^
Thanks in advance