1
我用Symfony2創建了一個使用Doctrine2的(Gedmo)可翻譯行爲擴展的多語言網站。這工作正常,但現在我正在尋找一種方法來使用ElasticaBundle創建一個不錯的searchoption。我希望德國用戶在德語翻譯中進行搜索,但也要在英文翻譯中進行搜索。通過使用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:
.....
,如果你想通過一個索引搜索,但搜索兩個指標似乎不可能與此軟件包或我錯了也能正常工作?
有沒有辦法做到這一點?任何幫助將不勝感激!
裏克
Thnx,我會試試這個。您的完整答案可以在https://github.com/Exercise/FOQElasticaBundle/issues/227#issuecomment-13282681 – Rick
找到。但是,然後你不能爲每種語言使用不同的分析儀,我說得對嗎?唉,問題的網址實際上是https://github.com/FriendsOfSymfony/FOSElasticaBundle/issues/227#issuecomment-13282681 – xPheRe