脚本宝典收集整理的这篇文章主要介绍了php – Symfony 2 FOQElasticaBundle搜索多个实体,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
如果您有这样的配置:
foq_elastica: clients: default: { host: localhost,port: 9200 } indexes: websITe: client: default tyPEs: user: mappings: username: { boost: 5 } FirstName: { boost: 3 } persistence: driver: orm # orm,mongodb,PRopel are available model: Application\UserBundle\Entity\User provider:
然后,您可以搜索这样的索引:
$userType = $this->container->get('foq_elastica.index.website.user'); $resultSet = $userType->search('bob');
配置:
foq_elastica: clients: default: { host: localhost,port: 9200 } indexes: website: client: default types: user: mappings: username: { boost: 5 } firstName: { boost: 3 } persistence: driver: orm model: Application\UserBundle\Entity\User provider: client: mappings: clientname: { boost: 5 } persistence: driver: orm model: Application\UserBundle\Entity\Client provider:
$Type = $this->container->get(['foq_elastica.index.website.user','foq_elastica.index.website.client']); $resultSet = $Type->search('bob');
以上是脚本宝典为你收集整理的php – Symfony 2 FOQElasticaBundle搜索多个实体全部内容,希望文章能够帮你解决php – Symfony 2 FOQElasticaBundle搜索多个实体所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。