FOSElasticaBundle and Doctrine Hydration

后端 未结 1 1119
忘掉有多难
忘掉有多难 2020-12-31 18:00

I\'m busy checking out elasticsearch for a new project that I\'m starting on. I\'m currently running Symfony2.5, with the latest FOSElasticaBundle and all that. I\'m doing s

相关标签:
1条回答
  • 2020-12-31 18:55

    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.

    0 讨论(0)
提交回复
热议问题