Skip to content
This repository was archived by the owner on Jun 19, 2022. It is now read-only.
This repository was archived by the owner on Jun 19, 2022. It is now read-only.

Delete index for object #6

Description

@emiraga

Just though it might help someone. I modified existing indexed_title_changed. Added new method to class Searchable

def delete_index(self):
    """Remove index entities for this model."""
    klass = StemmedIndex if self.INDEX_STEMMING else LiteralIndex
    query = klass.all(keys_only=True).ancestor(self.key())
    delete_keys = query.fetch(1000)
    db.delete(delete_keys)

When deleting record do this:
p.delete_index()
p.delete()

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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