批量导入数
第一步:写数据到txt,注意最后有换行符的。
第二步:执行请求
---
我们在nba的官网用爬虫爬一批数据。
---5-1---
{
"nba" : {
"aliases" : { },
"mappings" : {
"properties" : {
"age" : {
"type" : "integer"
},
"birthDay" : {
"type" : "date"
},
"birthDayStr" : {
"type" : "keyword"
},
"code" : {
"type" : "text"
},
"country" : {
"type" : "text"
},
"countryEn" : {
"type" : "text"
},
"displayAffiliation" : {
"type" : "text"
},
"displayName" : {
"type" : "text"
},
"displayNameEn" : {
"type" : "text"
},
"draft" : {
"type" : "long"
},
"heightValue" : {
"type" : "float"
},
"jerseyNo" : {
"type" : "text"
},
"playYear" : {
"type" : "long"
},
"playerId" : {
"type" : "keyword"
},
"position" : {
"type" : "text"
},
"schoolType" : {
"type" : "text"
},
"teamCity" : {
"type" : "text"
},
"teamCityEn" : {
"type" : "text"
},
"teamConference" : {
"type" : "keyword"
},
"teamConferenceEn" : {
"type" : "keyword"
},
"teamName" : {
"type" : "keyword"
},
"teamNameEn" : {
"type" : "keyword"
},
"weight" : {
"type" : "text"
}
}
},
"settings" : {
"index" : {
"creation_date" : "1589548474008",
"number_of_shards" : "1",
"number_of_replicas" : "1",
"uuid" : "0gvzCS3JTZaz7ynoLEDa7g",
"version" : {
"created" : "7020099"
},
"provided_name" : "nba"
}
}
}
}
---5-2---