Apply the changes to the index

def commit(self, index_update=True, label_guesser_update=True):
        """
        Apply the changes to the index
        """
        logger.info("Index: Commiting changes")
        if self.index_writer:
            if index_update:
                self.index_writer.commit()
            else:
                self.index_writer.cancel()
            del self.index_writer
        self.index_writer = None

        self.index.refresh()

        if self.label_guesser:
            if label_guesser_update and self.label_guesser_updater is not None:
                self.label_guesser_updater.commit()
            if index_update:
                self.reload_searcher()