Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ssl/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php FOSElasticaBundle创建/更新上载嵌套实体_Php_Symfony_Foselasticabundle - Fatal编程技术网

Php FOSElasticaBundle创建/更新上载嵌套实体

Php FOSElasticaBundle创建/更新上载嵌套实体,php,symfony,foselasticabundle,Php,Symfony,Foselasticabundle,救人 谁知道,fosElasticaBundle不上传嵌套实体,为什么?? 我有一个问题,当我在elastic中创建人才时,不要上载嵌套实体,而是在elastic中编辑此人才嵌套字段上载时。为什么编辑时不上传?? 创建时: $user->setDeveloper($developer); $this->getDoctrine()->getManager()->persist($user); $this->getDoctrine()->g

救人 谁知道,fosElasticaBundle不上传嵌套实体,为什么?? 我有一个问题,当我在elastic中创建人才时,不要上载嵌套实体,而是在elastic中编辑此人才嵌套字段上载时。为什么编辑时不上传?? 创建时:

    $user->setDeveloper($developer);
    $this->getDoctrine()->getManager()->persist($user);
    $this->getDoctrine()->getManager()->persist($developer);
    $manager->flush();
更新时:

    $manager->flush();
配置:

    fos_elastica:
clients:
    default:
      host: %elastica_host%
      port: %elastica_port%
      headers: { Authorization: Basic %elastica_auth_header% }

indexes:
    profile:
        finder: ~
        types:
             talent:
                mappings:
                    id:
                       type: integer
                    slug:
                       type: string
                    description:
                       type: string
                    user:
                        type: "nested"
                        properties:
                             id: ~
                             username:
                                type: string
当我更改嵌套实体时-第一个用户是开发人员,现在一切正常

            talent:
                mappings:
                      id: ~
                      username:
                          type: string
                      firstName:
                          type: string
                      developer:
                          type: "nested"
                          properties:
                              id:
                                 type: integer
                              slug:
                                 type: string
但我在团队中有实体团队,团队中有嵌套的实体开发人员,他们在开发人员中寻找嵌套用户。当我在elastic team中为团队创建developer not update时,只有当我编辑团队时,如何解决这个问题可能会覆盖一些我不知道的侦听器。当我创建开发人员时,我为这个开发人员刷新了团队,但仍然没有在elastic中更新

    indexes:
    profile:
        finder: ~
        types:
            team:
                 mappings:
                     id:
                       type: integer
                     slug:
                       type: string

                     developers:
                        type: "nested"
                        properties:
                            id:
                               type: integer
                            slug:
                               type: string
                            user:
                               type: "nested"
                               properties:
                                   id: ~
                                   username:
                                      type: string
                                   firstName:
                                      type: string
                          listener:
                        immediate: true

这是我的侦听器,可能需要这样的自定义插入

                    listener:
                        insert: true
                        update: true
                        delete: true
但我认为,如果听众:~这一切都是变种还是不是

                persistence:
                      driver: orm
                      model: Artel\ProfileBundle\Entity\Developer
                      provider: ~
                      listener: ~
                      finder: ~
我尝试这样做,但仍然嵌套实体不上传弹性

    indexes:
    profile:
        finder: ~
        types:
            team:
                 mappings:
                     id:
                       type: integer
                     slug:
                       type: string

                     developers:
                        type: "nested"
                        properties:
                            id:
                               type: integer
                            slug:
                               type: string
                            user:
                               type: "nested"
                               properties:
                                   id: ~
                                   username:
                                      type: string
                                   firstName:
                                      type: string
                          listener:
                        immediate: true
我尝试了这个,但仍然没有上传嵌套的(并且~这是默认的插入、更新、删除)


“帮助”

配置文件中是否有持久性/侦听器选项?你应该在github上检查这个我的监听器,也许需要像这样的自定义插入?listener:insert:true update:true delete:true但我认为如果listener:~这是所有变量还是没有?这个语法是另一个详细的语法,请看一下:immediate:true这是所有变量,flush和persistent实体和所有嵌套实体也上传到弹性体中?因为我不明白:侦听器:~#默认情况下,侦听“插入”、“更新”和“删除”并立即:true这只是flush实体true和我的问题-所有嵌套实体也上传弹性体?