gpt4 book ai didi

symfony - 您可以在同一实体的不同索引中定义两个或多个类型吗?

转载 作者:行者123 更新时间:2023-12-03 02:03:47 25 4
gpt4 key购买 nike

我将Elasticsearch 0.9与FOSElasticaBundle 3.0.0.alpha6和Symfony 2.5.10结合使用。
FOSElastica Listener会保持所有索引更新吗?我可以为每个环境定义不同的侦听器服务吗?我问我是否可以在生产,开发和测试环境中使用不同的索引。

最佳答案

Will FOSElastica Listener keep all indexes updated



是的,如果您将在配置文件中正确配置 persistence部分。

Can I define different listener services for each environment? I'm asking to see if I can use different indexes for the production, development and test environments.



如果我对您的了解很好,那么解决方案是 here
您只需在每个环境的配置(prod,dev,test)中设置其他索引名称即可。

甚至更好的是,您可以使用 kernel.env参数根据当前环境动态更改使用的索引:
#app/config/config.yml
fos_elastica:
indexes:
app:
index_name: app_%kernel.env%

关于symfony - 您可以在同一实体的不同索引中定义两个或多个类型吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28959140/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com