# NOT RUN {
x <- connect()
if (!index_exists(x, "twitter")) index_create(x, "twitter")
docs_create(x, 'twitter', id=1, body = list(
"user" = "foobar",
"post_date" = "2014-01-03",
"message" = "trying out Elasticsearch"
)
)
validate(x, "twitter", q='user:foobar')
validate(x, "twitter", q='user:foobar')
body <- '{
"query" : {
"bool" : {
"must" : {
"query_string" : {
"query" : "*:*"
}
},
"filter" : {
"term" : { "user" : "kimchy" }
}
}
}
}'
validate(x, "twitter", body = body)
# }
Run the code above in your browser using DataLab