## Not run:
# connect()
# if (!index_exists('plos')) {
# plosdat <- system.file("examples", "plos_data.json", package = "elastic")
# docs_bulk(plosdat)
# }
# if (!index_exists('omdb')) {
# omdb <- system.file("examples", "omdb.json", package = "elastic")
# 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)
# ## End(Not run)
Run the code above in your browser using DataLab