Skip to content

[Question] How to update an Elastic Search index doc over multiple entities #1971

@bertoost

Description

@bertoost

Hi there,

I have multiple entities which will be persisted to Doctrine separately from each other.
At the very end of each entity I want to update de index in elastic search with data from that entity, but now it removes the previous index keys which I want to keep. I just want to update the elastic search index with new/additional data instead of replacing the index.

For example; this is my fos_elastica setup;

indexes:
    customers:
      index_name: customers
      persistence:
        driver: orm
        model: App\Entity\Customer
        identifier: number
        provider: ~
        finder: ~
      properties:
        initials:
          property_path: voorletters
        prefix:
          property_path: voorvoegsels
        lastName:
          property_path: achternaam
        street:
          property_path: straat
        houseNr:
          property_path: huisnr
        zipcode:
          property_path: postcode
        city:
          property_path: plaats
        active:
          property_path: isActive

    customer_packages:
      index_name: customers
      persistence:
        driver: orm
        model: App\Entity\Package
        identifier: customer_number
        provider: ~
        finder: ~
      properties:
        packages:
          property_path: allNumbers

I could not find any option for this? Or did I miss something?

Kind regards,
Bert

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