search.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:cnschema 作者: cnschema 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号