我设法在我的symfony项目中安装了FOSElastica,我的fos_elsastica. yaml。
fos_elastica:
clients:
default: { host: localhost, port: 9200 }
indexes:
user:
persistence:
driver: orm
model: App\Entity\User
provider: ~
finder: ~
properties:
email: ~
是否可以在多个实体中搜索,例如:
fos_elastica:
clients:
default: { host: localhost, port: 9200 }
indexes:
user:
persistence:
driver: orm
model: App\Entity\User
provider: ~
finder: ~
properties:
email: ~
course:
persistence:
driver: orm
model: App\Entity\Course
provider: ~
finder: ~
properties:
name: ~
如果是,如何处理服务。yaml文件和控制器功能?我需要在正确的方向指出。
我尝试了很多方法,但都没有成功。
先谢了。
1条答案
按热度按时间dzhpxtsq1#
我不知道它的用途是什么。使用不同的索引有多种选择。
如果你想在另一个索引中搜索,你可以使用IndexManager,例如:
但如果你想合并索引,看看嵌套对象:https://github.com/FriendsOfSymfony/FOSElasticaBundle/blob/master/doc/indexes.md#nested-objects-in-foselasticabundle在文档中,我不知道你的实体设置,但这里有一个小例子与相同的假设。