4
from charmworld.models import CharmSource
6
from charmworld.search import (
12
def upgrade(db, index_client):
13
"""db is the pymongo db instance for our datastore. Charms are in db.charms
16
index_client is the ElasticSearch client.
18
log = logging.getLogger('migration_027')
19
log.warning('Starting')
20
charm_source = CharmSource(db, index_client)
22
index_client.delete_index()
23
log.warning("deleted index")
25
# It is already updated.
27
log.warning("Index already deleted")
29
cids = charm_source.sync_index()
35
log.warning("Index updated")