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