Skip to content

How to make plugin delete entry? WHERE filtering #600

@L4stIdi0t

Description

@L4stIdi0t

pgsync 4.1.0
es 9.x.x
pgs 15

I was wondering if there is a way to delete entries using plugins

class ActivePlugin(plugin.Plugin):
    """Plugin to filter only active."""

    name = "Active"

    def transform(self, doc, **kwargs):
        """Filter out non-active listings."""

        # Return None to skip indexing this document
        if doc.get("status") != "ACTIVE" or doc.get("processing_state") != "SUCCESS":
            return None # So that this would not make it index the entry or delete it if it was indexed in ES

        return doc

but when an item gets set to inactive it is not removed from the elasticsearch, how is this possible?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions