plosdat <- system.file("examples", "plos_data.json", package = "elastic")
docs_bulk(plosdat)
aliases_get()
index_delete(index='plos')
aliases_get()
# Curl options
library("httr")
plosdat <- system.file("examples", "plos_data.json", package = "elastic")
docs_bulk(plosdat, config=verbose())
# From a data.frame
docs_bulk(mtcars, index = "hello", type = "world")
docs_bulk(iris, "iris", "flowers")
## type can be missing, but index can not
docs_bulk(iris, "flowers")
## big data.frame, 53K rows, load ggplot2 package first
res <- docs_bulk(diamonds, "diam")
Search("diam")$hits$total
# From a list
docs_bulk(apply(iris, 1, as.list), index="iris", type="flowers")
docs_bulk(apply(USArrests, 1, as.list), index="arrests")
dim_list <- apply(diamonds, 1, as.list)
out <- docs_bulk(dim_list, index="diamfromlist")
Run the code above in your browser using DataLab