Skip to content

Deleting a nested object deletes the root object in index #64

Open
@boccheciampe

Description

@boccheciampe

Hi,

I have an index with nested objects (relationships), something like this:

@myindex.doc_type
class MyIndex(DocType):
    data = fields.NestedField(properties={
        'prop1': fields.StringField(),
        'prop2': fields.DateField(),
        [...]
    })

    class Meta:
        model = MyObject
        fields = [...]
        related_models = [Data]

    def get_instances_from_related(self, related_instance):
        return related_instance.myobject

Whenever a "data" object in inserted or updated in database, the "MyObject" index is updated. But when I delete a "data" object, the entire "MyObject" is deleted from the index, it is not updated with the "data" object removed.

Any idea ?

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions