Create the index

            Create the index with given configuration.
            If `indexname` is provided it will be used as the new index name
            instead of the class one (:py:attr:`DB.index_name`)

            :param index_conf: configuration to be used in index creation. If this
                              is not specified the default index configuration will be used.
            :raises Exception: if the index already exists.

def create_index(self, indexname=None, index_conf=None):
        ''' Create the index

            Create the index with given configuration.
            If `indexname` is provided it will be used as the new index name
            instead of the class one (:py:attr:`DB.index_name`)

            :param index_conf: configuration to be used in index creation. If this
                              is not specified the default index configuration will be used.
            :raises Exception: if the index already exists.
        '''
        if indexname is None:
            indexname = self.index_name
        log.debug("Creating new index: '{0}'".format(indexname))
        if index_conf is None:
            index_conf = {'settings': self.settings,
                          'mappings': {'book': {'properties': self.properties}}}
        try:
            self.es.indices.create(index=indexname, body=index_conf)
        except TransportError as te:
            if te.error.startswith("IndexAlreadyExistsException"):
                raise Exception("Cannot create index '{}', already exists".format(indexname))
            else:
                raise