Symfony 使用ElasticaBundle搜索多语言记录&;可译
我已经用Symfony2创建了一个多语言网站,使用Doctrine2的(Gedmo)可翻译行为扩展。这很好,但现在我正在寻找一种方法来使用ElasticaBundle创建一个不错的搜索选项。我希望德国用户搜索德语翻译,但也在英语翻译 目前,我正试图为每种语言使用单独的索引。我的config.yml如下所示:Symfony 使用ElasticaBundle搜索多语言记录&;可译,symfony,translation,
elasticsearch,multilingual,Symfony,Translation,
elasticsearch,Multilingual,我已经用Symfony2创建了一个多语言网站,使用Doctrine2的(Gedmo)可翻译行为扩展。这很好,但现在我正在寻找一种方法来使用ElasticaBundle创建一个不错的搜索选项。我希望德国用户搜索德语翻译,但也在英语翻译 目前,我正试图为每种语言使用单独的索引。我的config.yml如下所示: foq_elastica: clients: default: { host: localhost, port: 9200 } indexes
foq_elastica:
clients:
default: { host: localhost, port: 9200 }
indexes:
articles_en:
client:default
types:
article:
mappings:
name: { boost: 5, analyzer: my_analyzer }
persistence:
driver: orm
model: Test\SiteBundle\Entity\Article
identifier: id
provider:
service: elastica.translation.provider.article.en
finder:
articles_de:
....
articles_nl:
.....
如果您希望搜索一个索引,但使用此捆绑包搜索两个索引似乎是不可能的,或者我错了吗
有办法做到这一点吗?任何帮助都将不胜感激
Rick您可能应该为每种语言的每篇文章添加一个索引,然后在索引中添加一种语言。然后,您可以在索引中搜索一种或多种语言的文章。Thnx,我试试这个。你的完整答案可以找到athttps://github.com/Exercise/FOQElasticaBundle/issues/227#issuecomment-13282681但是你不能对每种语言使用不同的分析器,对吗?唉,问题的url实际上是