Skip to content

Search multi indexes for multi-language results #227

Description

@xantos05

I've created a multi-lingual website with Symfony2 using the (Gedmo) Translatable behavior extension for Doctrine2. This works fine but now i'm looking for a way to use the ElasticaBundle to create a nice searchoption. I want German users to search in the German-translation but also in the English translation.

At the moment i'm trying to use separate indexes for each language. My config.yml looks like this:

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:
        .....

This works fine if you want to search through one index but searching two indexes seems not possible with this bundle or am I wrong?

Is there a way to do this? Any help will be appreciated!

Rick

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions