西瓜滚雪
2018-09-02 23:04
如何批量导入数据?
最后一行需要回车换行
Kibana直接执行:
POST book/_doc/_bulk
{"index": {}}
{"word_count": 1000,"author": "张三","title": "移魂大法","publish_date": "2010-10-01"}
{"index": {}}
{"word_count": 2000,"author": "李三","title": "Java入门","publish_date": "2010-10-01"}
{"index": {}}
{"word_count": 2000,"author": "张四","title": "Python入门","publish_date": "2005-10-01"}
{"index": {}}
{"word_count": 1000,"author": "李四","title": "Elasticsearch大法好","publish_date": "2010-10-01"}
{"index": {}}
{"word_count": 5000,"author": "王五","title": "菜谱","publish_date": "2002-10-01"}
{"index": {}}
{"word_count": 10000,"author": "赵六","title": "剑谱","publish_date": "1997-01-01"}
{"index": {}}
{"word_count": 1000,"author": "张三丰","title": "太极拳","publish_date": "1997-01-01"}
{"index": {}}
{"word_count": 3000,"author": "瓦力","title": "Elasticsearch入门","publish_date": "2017-08-20"}
{"index": {}}
{"word_count": 3000,"author": "很胖的瓦力","title": "Elasticsearch精通","publish_date": "2017-08-15"}
{"index": {}}
{"word_count": 1000,"author": "牛魔王","title": "芭蕉扇","publish_date": "2000-10-01"}
{"index": {}}
{"word_count": 1000,"author": "孙悟空","title": "七十二变","publish_date": "2000-10-01"}
参考:https://blog.csdn.net/u013810234/article/details/104465210
不同的方式,小企业第一次访问时先从数据库查询,然后同步到es中,大企业用中间件进行操作
ElasticSearch入门
67741 学习 · 302 问题
相似问题