elasticsearch,ropensci,R,elasticsearch,Ropensci" /> elasticsearch,ropensci,R,elasticsearch,Ropensci" />

如何在R中使用弹性包中的index_create()索引数据

如何在R中使用弹性包中的index_create()索引数据,r,elasticsearch,ropensci,R,elasticsearch,Ropensci,这是我在R中用来索引虹膜数据的代码 library(elastic) iris<-datasets::iris body <- list(data = list(iris)) index_create(index = 'iris',body = body) elastic这里是维护人员索引\u创建仅用于创建函数名指示的索引。也就是说,创建索引,而不是创建索引并将数据插入索引。从你的例子中,你可能想要 index_create(index = "iris") docs_bulk(

这是我在R中用来索引虹膜数据的代码

library(elastic)
iris<-datasets::iris

body <- list(data = list(iris))

index_create(index = 'iris',body = body)

elastic
这里是维护人员<代码>索引\u创建仅用于创建函数名指示的索引。也就是说,创建索引,而不是创建索引并将数据插入索引。从你的例子中,你可能想要

index_create(index = "iris")
docs_bulk(iris, "iris")

索引创建(“索引”)映射创建(index=“indexname”,type=“data”,body=map.body)文档批量(dataset,index=“indexname”,type=“data”)。它告诉我400错误。索引已存在。执行已停止。但是如果我使用elasticsearchr包的elastic()函数。它成功地索引了数据,但存在数据映射问题。我认为错误是明显的,并且是正确的。您无法创建已经存在的索引(“自定义”(“,“customdata24”,“customdata24”)%create%mapping\u custom(toJSON(map.body,auto\u unbox=TRUE))不可见(docs\u bulk(index=“customdata24”,type=“customdata24”,myData,raw=FALSE,chunk\u size=100000))。通过使用mapping\u custom()完成通过传递自定义json参数实现弹性包的函数。
index_create(index = "iris")
docs_bulk(iris, "iris")