def __init__(self, config_file=None, settings=None, index_mappings=None): ''' :param index_name: :param index_type: ''' if settings is None: self.dbcfg = DBConfig(config_file=config_file) else: self.dbcfg = DBConfig(config_dict=settings) self._settings = self.dbcfg.settings self._index_name = self._settings['index_name'] self._index_type = self._settings['index_type'] self._host = self._settings['host'] self._index_mappings = index_mappings self.es = get_database(self._settings)