FriendsOfSymfony/FOSElasticaBundle — pull request #263 by AlexKovalevych (2013-03-31 20:16:53+00:00)
Title: fix listeners to not match child objects (which may be not indexable)

Consider such example:

/**
* Indexable class
*/
class Foo {}

/**
* Not indexable class
*/
class Bar extends Foo {}

In case Foo is indexable and Bar not, each time you create new Bar instance, it will be added to index since its an instance of Foo class too. As result you end up with Foo and Bar objects in the same index type. Since its most of all different tables\collections in the database, you will get exception "Cannot find corresponding Doctrine objects for all Elastica results".
This is the one of possible solutions.