nucypher / zerodb

*This project is no longer actively maintained. If you'd like to become the maintainer, please let us know.* ZeroDB is an end-to-end encrypted database. Data can be stored and queried on untrusted database servers without ever exposing the encryption key. Clients can execute remote queries against the encrypted data without downloading all of it or suffering an excessive performance hit.
GNU Affero General Public License v3.0
1.56k stars 102 forks source link

Use events for reindexing #21

Closed michwill closed 8 years ago

michwill commented 8 years ago

Right now, when changes are made to a document or object, one should run re-index manually (and commit).

That's not very convenient. It's much better to fire a zope event on change and put changes in a queue. At the commit event, the objects (or rather just changed fields) should be re-indexed automatically. Perhaps, good library to look at is collective.indexing

xueyumusic commented 8 years ago

Currently reindex seems to be called through dbmodel's _catalog attribute. Is there another way to call reindex or maybe could add reindex api in db.py

michwill commented 8 years ago

Yes, very good point!

xueyumusic commented 8 years ago

I implement this auto-reindex in this pr based on collective.indexing. Please review it

michwill commented 8 years ago

Awesome, thanks @xueyumusic ! Cleaned it up removing unnecessary Plone-specific things even further