rewrite sync_couchdb as preindex-plugin