# NOT RUN {
# basic search - copyright, metadata, data, and facet slots
(x <- as_search(q="bailout", begin_date = "20081001",
end_date = '20081005'))
x$copyright
x$meta
x$data
x$facet
Sys.sleep(1)
as_search(q="money", fq = 'The New York Times', fl = c('word_count',
'snippet', 'headline'))
Sys.sleep(1)
x <- as_search(q="bailout", hl = TRUE)
x$data$snippet
Sys.sleep(1)
# all results
(x <- as_search(q="bailout", begin_date = "20081001",
end_date = '20081003', all_results = TRUE))
x$meta
x$data
Sys.sleep(1)
# facetting
as_search(q="bailout", facet_field = 'section_name', begin_date = "20081001",
end_date = '20081201')
Sys.sleep(1)
## with facet filtering
as_search(q="bailout", facet_field = 'section_name', begin_date = "20081001",
end_date = '20081201', facet_filter = TRUE)
# curl options
x <- as_search(q="bailout", begin_date = "20081001",
end_date = '20081005', callopts = list(verbose = TRUE))
# }
Run the code above in your browser using DataLab