# NOT RUN {
connect()
if (!index_exists('plos')) {
plosdat <- system.file("examples", "plos_data.json", package = "elastic")
invisible(docs_bulk(plosdat))
}
if (!index_exists('omdb')) {
omdb <- system.file("examples", "omdb.json", package = "elastic")
invisible(docs_bulk(omdb))
}
body <- '{
"fields" : ["title"],
"offsets" : true,
"positions" : true,
"term_statistics" : true,
"field_statistics" : true
}'
termvectors('plos', 'article', 29, body = body)
body <- '{
"fields" : ["Plot"],
"offsets" : true,
"positions" : true,
"term_statistics" : true,
"field_statistics" : true
}'
termvectors('omdb', 'omdb', 'AVXdx8Eqg_0Z_tpMDyP_', body = body)
# }
Run the code above in your browser using DataLab