FOSElasticaBundle Created / Updated loading Nested Entity

Help someone. Who knows, fosElasticaBundle does not load a nested object, why? My question is, when I create talent in elastic, do not load the nested entity, but when EDIT this talent - the nested field is loaded into the elastic. Why, if you create talent embedded, do not download only when EDIT ?? while creating:

    $user->setDeveloper($developer);
    $this->getDoctrine()->getManager()->persist($user);
    $this->getDoctrine()->getManager()->persist($developer);
    $manager->flush();

when updating:

    $manager->flush();

configurations:

    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

when I change the nested entity - at first the user-developer everything works fine, now

            talent:
                mappings:
                      id: ~
                      username:
                          type: string
                      firstName:
                          type: string
                      developer:
                          type: "nested"
                          properties:
                              id:
                                 type: integer
                              slug:
                                 type: string

, , . , , , , , - , . , ,

    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:
                        insert: true
                        update: true
                        delete: true

, : ~ ?

                persistence:
                      driver: orm
                      model: Artel\ProfileBundle\Entity\Developer
                      provider: ~
                      listener: ~
                      finder: ~

,

                          listener:
                        immediate: true

, ( ~ , , )

                          listener:
                        insert: true
                        update: false
                        delete: true

+4

Source: https://habr.com/ru/post/1621433/


All Articles