我使用Doctrine2的(Gedmo)可翻译行为扩展,用Symfony2创建了一个多语言网站。这很好用,但现在我正在寻找一种方法来使用ElasticaBundle来创建一个很好的搜索选项。我希望德国用户搜索在德语翻译,但也在英语翻译。
目前,我正在尝试对每种语言使用单独的索引。我的config.yml看起来像这样:
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:
.....
如果您想通过一个索引进行搜索,但使用此包搜索两个索引似乎是不可能的,那么这很好用,还是我错了?
有没有办法做到这一点?任何帮助都将不胜感激!
瑞克
发布于 2013-02-06 16:56:43
您可能应该为每种语言的每个文章添加一个索引,并将一种语言添加到您的索引中。然后,您可以在索引中搜索一种或多种语言的文章。
https://stackoverflow.com/questions/14673178
复制相似问题