def forecast_event_to_es(): for _, security_item in get_security_list().iterrows(): # 创建索引 index_name = get_es_forecast_event_index(security_item['id']) es_index_mapping(index_name, ForecastEvent) for json_object in get_forecast_items(security_item): try: forcast_event = ForecastEvent(meta={'id': json_object['id']}) fill_doc_type(forcast_event, json_object) forcast_event.save() except Exception as e: logger.warn("wrong ForecastEvent:{},error:{}", json_object, e)
def forecast_event_to_es(): for _, security_item in get_security_list().iterrows(): # 创建索引 index_name = get_es_forecast_event_index(security_item['id']) es_index_mapping(index_name, ForecastEvent) for json_object in get_forecast_items(security_item): try: forcast_event = ForecastEvent(meta={'id': json_object['id']}) fill_doc_type(forcast_event, json_object) forcast_event.save() except Exception as e: logger.warn("wrong ForecastEvent:{},error:{}", json_object, e)