FOSElasticaBundle and Doctrine Hydration FOSElasticaBundle and Doctrine Hydration elasticsearch elasticsearch

FOSElasticaBundle and Doctrine Hydration


Found the answer... Little bit of sleep can get a person a long way it seems.

If anybody else is trying to figure this out, after going through the whole hydrate: false thing and what not (which is not related to this question in any way, by the way).

Simply use the service:

$this->get('fos_elastica.index.app.foo')->search($query) to get the Elastica Type instance.

$this->get('fos_elastica.finder.app.foo')->find($query) gets an array of Doctrine entities.

Hope this helps someone.