es 基本导入导出操作
- 安装elasticdump
首先安装nodejs
npm install elasticdump -g - 使用dump导出es数据到json
#导出data
elasticdump --input=http://host:9200/draft_eum_210000000000_1_1_7_5 --output=./draft_eum_210000000000_1_1_7_5.json --type=data
#导出mappingelasticdump --input=http://host:9200/draft_eum_210000000000_1_1_7_5 --output=./draft_eum_210000000000_1_1_7_5.json --type=mapping
- 使用dump导入es数据
elasticdump --input=new_field_34_1_1_5_1.jsonl --output=http://host:9201/eum_340000000000_1_1_5_1
-
使用kibana 创建mapping
PUT index { "settings": { "number_of_shards": 6 }, "mappings": { "properties": { "latest_enroll_year": { "type": "short" }, "sch_id": { "type": "keyword" }, "enroll_unit_name": { "type": "text", "analyzer": "ik_max_word" }, "is_new_sch": { "type": "boolean" }, "enroll_major_info_list": { "type": "nested", "properties": { "is_new_major": { "type": "boolean" } } } } } }
-
stay hungry stay foolish!