Ejemplo n.º 1
0
 def _run(self):
     logging.info('Create index and loading mapping: %s/%s',
                  self.target_index_name, self.target_type_name)
     es = elasticsearch.Elasticsearch(self.target_host, timeout=120)
     if self.delete_index:
         elasticsearch_requests.clear_and_load(es, self.target_index_name,
                                               self.target_type_name,
                                               self.target_mapping_file)
     else:
         elasticsearch_requests.load_mapping(es, self.target_index_name,
                                             self.target_type_name,
                                             self.target_mapping_file)
Ejemplo n.º 2
0
 def _run(self):
   logging.info('Create index and loading mapping: %s/%s',
                self.target_index_name, self.target_type_name)
   es = elasticsearch.Elasticsearch(self.target_host)
   if self.delete_index:
     elasticsearch_requests.clear_and_load(es,
                                       self.target_index_name,
                                       self.target_type_name,
                                       self.target_mapping_file)
   else:
     elasticsearch_requests.load_mapping(es,
                                         self.target_index_name,
                                         self.target_type_name,
                                         self.target_mapping_file)