def load_data(self):
"""
https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-suggesters-completion.html
"""
es = self.connect()
items = self._load_item_data()
helpers.bulk(es, items)
# id_field = "id"
# es_index = self.es_config["es_index"]
# es_type = self.es_config["es_type"]
# for item in items:
# item = item['_source']
# logging.info(json.dumps(item, ensure_ascii=False, indent=4))
#
# ret = es.index(index=es_index, doc_type=es_type, id=item[id_field], body=item)
# logging.info(ret)
评论列表
文章目录