4

Help somebody Who knows, fosElasticaBundle not upload nested entity, why ?? I have question, when I create talent in elastic don't upload nested entity but when EDIT this talent - nested field upload in elastic. Why if create talent nested not upload only when EDIT?? when created:

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

when updated:

    $manager->flush();

config:

    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 nested entity - first User thean developer everything ok, now

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

but I have entity team in team have nested entity developer who look in developer in developer nested users. And hen I create developer for team in elastic team not update, only when I edit team, how fix this problem maybe overwrite some listener I don't know. When I create developer I flush team for this developer but still not update in 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

this my listener, maybe need custom insert like this?

                    listener:
                        insert: true
                        update: true
                        delete: true

But I think if listener: ~ this all variant or not ?

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

I try like this, but still nested entity not upload in elastic

                          listener:
                        immediate: true

And I try this, but still not upload nested(and ~ this is default insert, update, delete)

                          listener:
                        insert: true
                        update: false
                        delete: true

help please

shuba.ivan
  • 3,824
  • 8
  • 49
  • 121
  • Have you a persistence / listener option to your configuration file ? You should have to check this on github https://github.com/FriendsOfSymfony/FOSElasticaBundle/issues/730 – Sylvain Martin Jan 07 '16 at 21:03
  • this my listener, maybe need custom insert like this? listener: insert: true update: true delete: true But I think if listener: ~ this all variant or not ? – shuba.ivan Jan 12 '16 at 14:58
  • this syntax is another detailed syntax, have a look at this: https://github.com/FriendsOfSymfony/FOSElasticaBundle/blob/master/Resources/doc/types.md#listener-configuration – Sylvain Martin Jan 13 '16 at 10:38
  • immediate: true this is all variant, flush and persist entity and all nested entity upload in elastic too ? – shuba.ivan Jan 13 '16 at 10:43
  • because I not understand: listener: ~ # by default, listens to "insert", "update" and "delete" And immediate: true this is only flush entity true and my question - all nested entity upload elastic too ? – shuba.ivan Jan 13 '16 at 10:47
  • I update my question – shuba.ivan Jan 13 '16 at 12:43

0 Answers0