r - 如何在R中的弹性包中使用index_create()为数据建立索引

标签 r elasticsearch ropensci

这是我在R中为虹膜数据编制索引的代码。

library(elastic)
iris<-datasets::iris

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

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

但它给出以下错误。
Error: 400 - Failed to parse content to map. 
Please explain how to give data in the body of the index_create();

最佳答案

elastic维护者在这里。 index_create仅用于如函数名所示创建索引。也就是说,创建索引,而不是创建索引并将数据插入索引中。从您的示例中,您可能想要

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

关于r - 如何在R中的弹性包中使用index_create()为数据建立索引,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47096215/

相关文章:

JAVA 8没有jrunscript,只有jjs

r - 使用 R 访问 ACM 数字图书馆 - 没有 API 那么怎么可能?

r - 使用rentrez在R中解析XML文件

r - 将 'multifeature' GeoJSON 的特征转换为 R 空间对象

r - R 中的 colMeans 函数并遇到大小为 1 的列的问题

r - ggplot2 2.0.0 中的 geom_point 边界

elasticsearch - 如何删除ELK中的旧日志以给每个应用程序一定的磁盘配额

在调用依赖于 renderUI 的响应式(Reactive)函数之前,不会执行 renderUI

r - 将多个回归表输出到 R 中的 Word 文档的多个页面中

java - 使用Java中的JEST API向索引添加别名并删除索引