https://github.com/FriendsOfSymfony/FOSElasticaBundle/pull/660