Ejemplo n.º 1
0
 def _map_incremental(self, map_input):
   es = elasticsearch.Elasticsearch(self.es_host, timeout=120)
   with BatchHelper(index_with_checksum, es, self.index_name, self.type_name) as helper:
     for key, doc in map_input:
       assert self.docid_key in doc, 'Document is missing id field: %s' % json.dumps(doc, indent=2)
       doc_id = doc[self.docid_key]
       helper.add((doc_id, doc))
Ejemplo n.º 2
0
 def _map_non_incremental(self, map_input):
     es = elasticsearch.Elasticsearch(self.es_host, timeout=120)
     with BatchHelper(index_without_checksum, es, self.index_name,
                      self.type_name) as helper:
         for key, doc in map_input:
             helper.add(doc)