elasticsearch,foselasticabundle,Symfony,elasticsearch,Foselasticabundle" /> elasticsearch,foselasticabundle,Symfony,elasticsearch,Foselasticabundle" />

Symfony 用FosElasticaBundle索引外键标签

Symfony 用FosElasticaBundle索引外键标签,symfony,elasticsearch,foselasticabundle,Symfony,elasticsearch,Foselasticabundle,当我索引关系数据库Postgresql时,我想获取外键id的字符串值intead,并重新创建两个表personn和country之间的关系。。 我希望在fos_elastica.yml映射文件中这样做 例如: fos_elastica: clients: default: { host: %elastic_host%, port: %elastic_port% } indexes: ex_app: client: defau

当我索引关系数据库Postgresql时,我想获取外键id的字符串值intead,并重新创建两个表personn和country之间的关系。。 我希望在fos_elastica.yml映射文件中这样做

例如:

fos_elastica:
    clients:
        default: { host: %elastic_host%, port: %elastic_port% }
    indexes:
        ex_app:
            client: default
            types:
                personn:
                    mappings:
                        id:
                            type: integer
                        name:
                            type: text
                            boost: 5
                        firstname:
                            type: text
                            boost: 3
                        dateofbirth:
                            type: date
                        country:
                            type: integer
                    persistence:
                        driver: orm
                        model: AppBundle\Entity\Personn
                        finder: ~
                        provider: ~
                        listener: ~

我想通过键入国家名称而不是国家id来查找此人。

我很确定您应该使用嵌套的:

fos_elastica:
        clients:
            default: { host: %elastic_host%, port: %elastic_port% }
        indexes:
            ex_app:
                client: default
                types:
                    personn:
                        mappings:
                            id:
                                type: integer
                            name:
                                type: text
                                boost: 5
                            firstname:
                                type: text
                                boost: 3
                            dateofbirth:
                                type: date
                            country:
                                type: "nested"
                                 properties:
                                 id: 
                                    type : integer
                                 label: 
                                    type: text 
                        persistence:
                            driver: orm
                            model: AppBundle\Entity\Personn
                            finder: ~
                            provider: ~
                            listener: ~

你需要用英语写你的问题-好的,我会尽力的。