scout/adapter/mongo/index.py
def update_indexes(self):
        """Update the indexes
        
        If there are any indexes that are not added to the database, add those.

        """
        LOG.info("Updating indexes...")
        nr_updated = 0
        for collection_name in INDEXES:
            existing_indexes = self.indexes(collection_name)
            indexes = INDEXES[collection_name]
            for index in indexes:
                index_name = index.document.get('name')
                if index_name not in existing_indexes:
                    nr_updated += 1
                    LOG.info("Adding index : %s" % index_name)
                    self.db[collection_name].create_indexes(indexes)
        if nr_updated == 0:
            LOG.info("All indexes in place")
def update_indexes(self):
        """Update the indexes
        
        If there are any indexes that are not added to the database, add those.

        """
        LOG.info("Updating indexes...")
        nr_updated = 0
        for collection_name in INDEXES:
            existing_indexes = self.indexes(collection_name)
            indexes = INDEXES[collection_name]
            for index in indexes:
                index_name = index.document.get('name')
                if index_name not in existing_indexes:
                    nr_updated += 1
                    LOG.info("Adding index : %s" % index_name)
                    self.db[collection_name].create_indexes(indexes)
        if nr_updated == 0:
            LOG.info("All indexes in place")
Update the indexes
        
        If there are any indexes that are not added to the database, add those.