1

我使用 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:
        .....

如果您想搜索一个索引,但此捆绑包似乎无法搜索两个索引,这很好用,还是我错了?

有没有办法做到这一点?任何帮助将不胜感激!

瑞克

4

1 回答 1

3

您可能应该只为每种语言的每篇文章添加一个索引,并将一种语言添加到您的索引中。然后,您可以在索引中搜索一种或多种语言的文章。

于 2013-02-06T08:56:42.907 回答