ElasticSearch7.2之批量导⼊数据

  • ES提供了⼀个叫 bulk API 来进⾏批量操作

  • 语法:curl -X POST "elasticsearch-1:9200/_bulk" -H 'Content-Type: application/json' --data-binary @player

        player是要导入的数据文件的名称

  • 数据:注意最后一行一定要回车

{"index":{"_index":"nba","_type":"_doc","_id":"1"}}
{"countryEn":"United States","teamName":"老鹰","birthDay":831182400000,"country":"美国","teamCityEn":"Atlanta","code":"jaylen_adams","displayAffiliation":"United States","displayName":"杰伦 亚当斯","schoolType":"College","teamConference":"东部","teamConferenceEn":"Eastern","weight":"86.2 公斤","teamCity":"亚特兰大","playYear":1,"jerseyNo":"10","teamNameEn":"Hawks","draft":2018,"displayNameEn":"Jaylen Adams","heightValue":1.88,"birthDayStr":"1996-05-04","position":"后卫","age":23,"playerId":"1629121"}
{"index":{"_index":"nba","_type":"_doc","_id":"2"}}
{"countryEn":"New Zealand","teamName":"雷霆","birthDay":743140800000,"country":"新西兰","teamCityEn":"Oklahoma City","code":"steven_adams","displayAffiliation":"Pittsburgh/New Zealand","displayName":"斯蒂文 亚当斯","schoolType":"College","teamConference":"西部","teamConferenceEn":"Western","weight":"120.2 公斤","teamCity":"俄克拉荷马城","playYear":6,"jerseyNo":"12","teamNameEn":"Thunder","draft":2013,"displayNameEn":"Steven Adams","heightValue":2.13,"birthDayStr":"1993-07-20","position":"中锋","age":26,"playerId":"203500"}
{"index":{"_index":"nba","_type":"_doc","_id":"3"}}
{"countryEn":"United States","teamName":"热火","birthDay":869198400000,"country":"美国","teamCityEn":"Miami","code":"bam_adebayo","displayAffiliation":"Kentucky/United States","displayName":"巴姆 阿德巴约","schoolType":"College","teamConference":"东部","teamConferenceEn":"Eastern","weight":"115.7 公斤","teamCity":"迈阿密","playYear":2,"jerseyNo":"13","teamNameEn":"Heat","draft":2017,"displayNameEn":"Bam Adebayo","heightValue":2.08,"birthDayStr":"1997-07-18","position":"中锋-前锋","age":22,"playerId":"1628389"}
{"index":{"_index":"nba","_type":"_doc","_id":"4"}}
{"countryEn":"South Sudan","teamName":"骑士","birthDay":854773200000,"country":"南苏丹","teamCityEn":"Cleveland","code":"deng_adel","displayAffiliation":"University of Louisville/South Sudan","displayName":"邓 Adel","schoolType":"","teamConference":"东部","teamConferenceEn":"Eastern","weight":"90.7 公斤","teamCity":"克利夫兰","playYear":1,"jerseyNo":"32","teamNameEn":"Cavaliers","draft":2018,"displayNameEn":"Deng Adel","heightValue":2.01,"birthDayStr":"1997-02-01","position":"前锋","age":22,"playerId":"1629061"}
{"index":{"_index":"nba","_type":"_doc","_id":"5"}}
{"countryEn":"United States","teamName":"马刺","birthDay":490593600000,"country":"美国","teamCityEn":"San Antonio","code":"lamarcus_aldridge","displayAffiliation":"Texas/United States","displayName":"拉马库斯 阿尔德里奇","schoolType":"College","teamConference":"西部","teamConferenceEn":"Western","weight":"117.9 公斤","teamCity":"圣安东尼奥","playYear":13,"jerseyNo":"12","teamNameEn":"Spurs","draft":2006,"displayNameEn":"LaMarcus Aldridge","heightValue":2.11,"birthDayStr":"1985-07-19","position":"中锋-前锋","age":34,"playerId":"200746"}
{"index":{"_index":"nba","_type":"_doc","_id":"6"}}
{"countryEn":"Canada","teamName":"鹈鹕","birthDay":887000400000,"country":"加拿大","teamCityEn":"New Orleans","code":"nickeil_alexander-walker","displayAffiliation":"Virginia Tech/Canada","displayName":"Nickeil Alexander-Walker","schoolType":"College","teamConference":"西部","teamConferenceEn":"Western","weight":"92.5 公斤","teamCity":"新奥尔良","playYear":0,"jerseyNo":"","teamNameEn":"Pelicans","draft":2019,"displayNameEn":"Nickeil Alexander-Walker","heightValue":1.96,"birthDayStr":"1998-02-09","position":"后卫","age":21,"playerId":"1629638"}
{"index":{"_index":"nba","_type":"_doc","_id":"7"}}
{"countryEn":"United States","teamName":"公牛","birthDay":878101200000,"country":"美国","teamCityEn":"Chicago","code":"rawle_alkins","displayAffiliation":"University of Arizona/United States","displayName":"劳勒 Alkins","schoolType":"","teamConference":"东部","teamConferenceEn":"Eastern","weight":"102.1 公斤","teamCity":"芝加哥","playYear":1,"jerseyNo":"20","teamNameEn":"Bulls","draft":2018,"displayNameEn":"Rawle Alkins","heightValue":1.96,"birthDayStr":"1997-10-29","position":"后卫","age":22,"playerId":"1628959"}
{"index":{"_index":"nba","_type":"_doc","_id":"8"}}
{"countryEn":"United States","teamName":"灰熊","birthDay":813124800000,"country":"美国","teamCityEn":"Memphis","code":"","displayAffiliation":"Duke University/United States","displayName":"格雷森 艾伦","schoolType":"College","teamConference":"西部","teamConferenceEn":"Western","weight":"89.8 公斤","teamCity":"孟菲斯","playYear":1,"jerseyNo":"","teamNameEn":"Grizzlies","draft":2018,"displayNameEn":"Grayson Allen","heightValue":1.96,"birthDayStr":"1995-10-08","position":"后卫","age":24,"playerId":"1628960"}
{"index":{"_index":"nba","_type":"_doc","_id":"9"}}
{"countryEn":"United States","teamName":"篮网","birthDay":893131200000,"country":"美国","teamCityEn":"Brooklyn","code":"jarrett_allen","displayAffiliation":"Texas/United States","displayName":"贾瑞特 艾伦","schoolType":"College","teamConference":"东部","teamConferenceEn":"Eastern","weight":"107.5 公斤","teamCity":"布鲁克林","playYear":2,"jerseyNo":"31","teamNameEn":"Nets","draft":2017,"displayNameEn":"Jarrett Allen","heightValue":2.11,"birthDayStr":"1998-04-21","position":"中锋","age":21,"playerId":"1628386"}
{"index":{"_index":"nba","_type":"_doc","_id":"10"}}
{"countryEn":"United States","teamName":"尼克斯","birthDay":727074000000,"country":"美国","teamCityEn":"New York","code":"kadeem_allen","displayAffiliation":"Arizona/United States","displayName":"卡迪姆 艾伦","schoolType":"College","teamConference":"东部","teamConferenceEn":"Eastern","weight":"90.7 公斤","teamCity":"纽约","playYear":2,"jerseyNo":"0","teamNameEn":"Knicks","draft":2017,"displayNameEn":"Kadeem Allen","heightValue":1.9,"birthDayStr":"1993-01-15","position":"后卫","age":26,"playerId":"1628443"}
{"index":{"_index":"nba","_type":"_doc","_id":"11"}}
{"countryEn":"United States","teamName":"魔术","birthDay":653889600000,"country":"美国","teamCityEn":"Orlando","code":"al-farouq_aminu","displayAffiliation":"Wake Forest/United States","displayName":"艾尔-法鲁克 阿米奴","schoolType":"College","teamConference":"东部","teamConferenceEn":"Eastern","weight":"99.8 公斤","teamCity":"奥兰多","playYear":9,"jerseyNo":"2","teamNameEn":"Magic","draft":2010,"displayNameEn":"Al-Farouq Aminu","heightValue":2.06,"birthDayStr":"1990-09-21","position":"前锋","age":29,"playerId":"202329"}
{"index":{"_index":"nba","_type":"_doc","_id":"12"}}
{"countryEn":"United States","teamName":"老鹰","birthDay":753685200000,"country":"美国","teamCityEn":"Atlanta","code":"justin_anderson","displayAffiliation":"Virginia/United States","displayName":"贾斯汀 安德森","schoolType":"College","teamConference":"东部","teamConferenceEn":"Eastern","weight":"104.3 公斤","teamCity":"亚特兰大","playYear":4,"jerseyNo":"1","teamNameEn":"Hawks","draft":2015,"displayNameEn":"Justin Anderson","heightValue":1.98,"birthDayStr":"1993-11-19","position":"后卫-前锋","age":26,"playerId":"1626147"}
{"index":{"_index":"nba","_type":"_doc","_id":"13"}}
{"countryEn":"United States","teamName":"灰熊","birthDay":748497600000,"country":"美国","teamCityEn":"Memphis","code":"kyle_anderson","displayAffiliation":"UCLA/United States","displayName":"凯尔 安德森","schoolType":"College","teamConference":"西部","teamConferenceEn":"Western","weight":"104.3 公斤","teamCity":"孟菲斯","playYear":5,"jerseyNo":"1","teamNameEn":"Grizzlies","draft":2014,"displayNameEn":"Kyle Anderson","heightValue":2.06,"birthDayStr":"1993-09-20","position":"前锋","age":26,"playerId":"203937"}
{"index":{"_index":"nba","_type":"_doc","_id":"14"}}
{"countryEn":"Greece","teamName":"雄鹿","birthDay":786690000000,"country":"希腊","teamCityEn":"Milwaukee","code":"giannis_antetokounmpo","displayAffiliation":"Greece","displayName":"扬尼斯 安特托昆博","schoolType":"","teamConference":"东部","teamConferenceEn":"Eastern","weight":"109.8 公斤","teamCity":"密尔沃基","playYear":6,"jerseyNo":"34","teamNameEn":"Bucks","draft":2013,"displayNameEn":"Giannis Antetokounmpo","heightValue":2.11,"birthDayStr":"1994-12-06","position":"前锋","age":25,"playerId":"203507"}
{"index":{"_index":"nba","_type":"_doc","_id":"15"}}
{"countryEn":"Greece","teamName":"独行侠","birthDay":880002000000,"country":"希腊","teamCityEn":"Dallas","code":"kostas_antetokounmpo","displayAffiliation":"University of Dayton/Greece","displayName":"克斯塔斯 安特托昆博","schoolType":"College","teamConference":"西部","teamConferenceEn":"Western","weight":"90.7 公斤","teamCity":"达拉斯","playYear":1,"jerseyNo":"37","teamNameEn":"Mavericks","draft":2018,"displayNameEn":"Kostas Antetokounmpo","heightValue":2.08,"birthDayStr":"1997-11-20","position":"前锋","age":22,"playerId":"1628961"}
{"index":{"_index":"nba","_type":"_doc","_id":"16"}}
{"countryEn":"United Kingdom","teamName":"猛龙","birthDay":869112000000,"country":"英国","teamCityEn":"Toronto","code":"og_anunoby","displayAffiliation":"Indiana/United Kingdom","displayName":"OG 安纳诺比","schoolType":"College","teamConference":"东部","teamConferenceEn":"Eastern","weight":"105.2 公斤","teamCity":"多伦多","playYear":2,"jerseyNo":"3","teamNameEn":"Raptors","draft":2017,"displayNameEn":"OG Anunoby","heightValue":2.03,"birthDayStr":"1997-07-17","position":"前锋","age":22,"playerId":"1628384"}
{"index":{"_index":"nba","_type":"_doc","_id":"17"}}
{"countryEn":"United States","teamName":"公牛","birthDay":764658000000,"country":"美国","teamCityEn":"Chicago","code":"ryan_arcidiacono","displayAffiliation":"Villanova/United States","displayName":"莱恩 阿什迪亚克诺","schoolType":"College","teamConference":"东部","teamConferenceEn":"Eastern","weight":"90.7 公斤","teamCity":"芝加哥","playYear":2,"jerseyNo":"51","teamNameEn":"Bulls","draft":2016,"displayNameEn":"Ryan Arcidiacono","heightValue":1.9,"birthDayStr":"1994-03-26","position":"后卫","age":25,"playerId":"1627853"}
{"index":{"_index":"nba","_type":"_doc","_id":"18"}}
{"countryEn":"United States","teamName":"国王","birthDay":488952000000,"country":"美国","teamCityEn":"Sacramento","code":"trevor_ariza","displayAffiliation":"UCLA/United States","displayName":"特雷沃 阿里扎","schoolType":"College","teamConference":"西部","teamConferenceEn":"Western","weight":"97.5 公斤","teamCity":"萨克拉门托","playYear":15,"jerseyNo":"0","teamNameEn":"Kings","draft":2004,"displayNameEn":"Trevor Ariza","heightValue":2.03,"birthDayStr":"1985-06-30","position":"前锋","age":34,"playerId":"2772"}
{"index":{"_index":"nba","_type":"_doc","_id":"19"}}
{"countryEn":"United States","teamName":"魔术","birthDay":563518800000,"country":"美国","teamCityEn":"Orlando","code":"d.j._augustin","displayAffiliation":"Texas/United States","displayName":"D.J. 奥古斯汀","schoolType":"College","teamConference":"东部","teamConferenceEn":"Eastern","weight":"83.0 公斤","teamCity":"奥兰多","playYear":11,"jerseyNo":"14","teamNameEn":"Magic","draft":2008,"displayNameEn":"D.J. Augustin","heightValue":1.83,"birthDayStr":"1987-11-10","position":"后卫","age":32,"playerId":"201571"}
{"index":{"_index":"nba","_type":"_doc","_id":"20"}}
{"countryEn":"Bahamas","teamName":"太阳","birthDay":901166400000,"country":"巴哈马","teamCityEn":"Phoenix","code":"deandre_ayton","displayAffiliation":"University of Arizona/Bahamas","displayName":"德安德烈 艾顿","schoolType":"College","teamConference":"西部","teamConferenceEn":"Western","weight":"113.4 公斤","teamCity":"菲尼克斯","playYear":1,"jerseyNo":"22","teamNameEn":"Suns","draft":2018,"displayNameEn":"Deandre Ayton","heightValue":2.16,"birthDayStr":"1998-07-23","position":"前锋","age":21,"playerId":"1629028"}
{"index":{"_index":"nba","_type":"_doc","_id":"21"}}
{"countryEn":"United States","teamName":"黄蜂","birthDay":809755200000,"country":"美国","teamCityEn":"Charlotte","code":"dwayne_bacon","displayAffiliation":"Florida State/United States","displayName":"德维恩 培根","schoolType":"College","teamConference":"东部","teamConferenceEn":"Eastern","weight":"100.2 公斤","teamCity":"夏洛特","playYear":2,"jerseyNo":"7","teamNameEn":"Hornets","draft":2017,"displayNameEn":"Dwayne Bacon","heightValue":2.01,"birthDayStr":"1995-08-30","position":"后卫-前锋","age":24,"playerId":"1628407"}
{"index":{"_index":"nba","_type":"_doc","_id":"22"}}
{"countryEn":"United States","teamName":"国王","birthDay":921387600000,"country":"美国","teamCityEn":"Sacramento","code":"marvin_bagley_iii","displayAffiliation":"Duke University/United States","displayName":"马尔文 巴格莱三世","schoolType":"College","teamConference":"西部","teamConferenceEn":"Western","weight":"106.1 公斤","teamCity":"萨克拉门托","playYear":1,"jerseyNo":"35","teamNameEn":"Kings","draft":2018,"displayNameEn":"Marvin Bagley III","heightValue":2.11,"birthDayStr":"1999-03-14","position":"前锋","age":20,"playerId":"1628963"}
{"index":{"_index":"nba","_type":"_doc","_id":"23"}}
{"countryEn":"United States","teamName":"鹈鹕","birthDay":877928400000,"country":"美国","teamCityEn":"New Orleans","code":"lonzo_ball","displayAffiliation":"UCLA/United States","displayName":"朗佐 鲍尔","schoolType":"College","teamConference":"西部","teamConferenceEn":"Western","weight":"86.2 公斤","teamCity":"新奥尔良","playYear":2,"jerseyNo":"","teamNameEn":"Pelicans","draft":2017,"displayNameEn":"Lonzo Ball","heightValue":1.98,"birthDayStr":"1997-10-27","position":"后卫","age":22,"playerId":"1628366"}
{"index":{"_index":"nba","_type":"_doc","_id":"24"}}
{"countryEn":"United States","teamName":"魔术","birthDay":894945600000,"country":"美国","teamCityEn":"Orlando","code":"mohamed_bamba","displayAffiliation":"University of Texas at Austin/United States","displayName":"莫 班巴","schoolType":"College","teamConference":"东部","teamConferenceEn":"Eastern","weight":"100.2 公斤","teamCity":"奥兰多","playYear":1,"jerseyNo":"5","teamNameEn":"Magic","draft":2018,"displayNameEn":"Mo Bamba","heightValue":2.13,"birthDayStr":"1998-05-12","position":"中锋","age":21,"playerId":"1628964"}
{"index":{"_index":"nba","_type":"_doc","_id":"25"}}
{"countryEn":"Puerto Rico","teamName":"独行侠","birthDay":457070400000,"country":"波多黎各","teamCityEn":"Dallas","code":"j.j._barea","displayAffiliation":"Northeastern/Puerto Rico","displayName":"J.J. 巴里亚","schoolType":"College","teamConference":"西部","teamConferenceEn":"Western","weight":"83.9 公斤","teamCity":"达拉斯","playYear":13,"jerseyNo":"5","teamNameEn":"Mavericks","draft":2006,"displayNameEn":"J.J. Barea","heightValue":1.83,"birthDayStr":"1984-06-26","position":"后卫","age":35,"playerId":"200826"}
{"index":{"_index":"nba","_type":"_doc","_id":"26"}}
{"countryEn":"United States","teamName":"国王","birthDay":707198400000,"country":"美国","teamCityEn":"Sacramento","code":"harrison_barnes","displayAffiliation":"North Carolina/United States","displayName":"哈里森 巴恩斯","schoolType":"College","teamConference":"西部","teamConferenceEn":"Western","weight":"102.1 公斤","teamCity":"萨克拉门托","playYear":7,"jerseyNo":"40","teamNameEn":"Kings","draft":2012,"displayNameEn":"Harrison Barnes","heightValue":2.03,"birthDayStr":"1992-05-30","position":"前锋","age":27,"playerId":"203084"}
{"index":{"_index":"nba","_type":"_doc","_id":"27"}}
{"countryEn":"Canada","teamName":"尼克斯","birthDay":963547200000,"country":"加拿大","teamCityEn":"New York","code":"rj_barrett","displayAffiliation":"Duke University/Canada","displayName":"RJ 巴雷特","schoolType":"College","teamConference":"东部","teamConferenceEn":"Eastern","weight":"91.6 公斤","teamCity":"纽约","playYear":0,"jerseyNo":"9","teamNameEn":"Knicks","draft":2019,"displayNameEn":"RJ Barrett","heightValue":2.01,"birthDayStr":"2000-07-14","position":"前锋-后卫","age":19,"playerId":"1629628"}
{"index":{"_index":"nba","_type":"_doc","_id":"28"}}
{"countryEn":"United States","teamName":"掘金","birthDay":663138000000,"country":"美国","teamCityEn":"Denver","code":"will_barton","displayAffiliation":"Memphis/United States","displayName":"威尔 巴顿","schoolType":"College","teamConference":"西部","teamConferenceEn":"Western","weight":"86.2 公斤","teamCity":"丹佛","playYear":7,"jerseyNo":"5","teamNameEn":"Nuggets","draft":2012,"displayNameEn":"Will Barton","heightValue":1.98,"birthDayStr":"1991-01-06","position":"后卫","age":28,"playerId":"203115"}
{"index":{"_index":"nba","_type":"_doc","_id":"29"}}
{"countryEn":"United States","teamName":"森林狼","birthDay":822373200000,"country":"美国","teamCityEn":"Minnesota","code":"keita_bates-diop","displayAffiliation":"Ohio State University/United States","displayName":"凯塔 贝茨-迪奥普","schoolType":"College","teamConference":"西部","teamConferenceEn":"Western","weight":"103.9 公斤","teamCity":"明尼苏达","playYear":1,"jerseyNo":"31","teamNameEn":"Timberwolves","draft":2018,"displayNameEn":"Keita Bates-Diop","heightValue":2.06,"birthDayStr":"1996-01-23","position":"前锋","age":23,"playerId":"1628966"}
{"index":{"_index":"nba","_type":"_doc","_id":"30"}}
{"countryEn":"France","teamName":"黄蜂","birthDay":598078800000,"country":"法国","teamCityEn":"Charlotte","code":"nicolas_batum","displayAffiliation":"France","displayName":"尼古拉斯 巴图姆","schoolType":"","teamConference":"东部","teamConferenceEn":"Eastern","weight":"90.7 公斤","teamCity":"夏洛特","playYear":11,"jerseyNo":"5","teamNameEn":"Hornets","draft":2008,"displayNameEn":"Nicolas Batum","heightValue":2.03,"birthDayStr":"1988-12-14","position":"前锋-后卫","age":31,"playerId":"201587"}
发布了92 篇原创文章 · 获赞 3 · 访问量 5162

猜你喜欢

转载自blog.csdn.net/qq_22049773/article/details/103092081