nr_search: Search

Description Usage Arguments Sort Examples

Description

Search for articles.

Usage

1
nr_search(q, sort_by = NULL, sort_order = NULL, results = 100)

Arguments

q

Your search query, i.e.: text:(Barack AND Obama), more details https://console.newsriver.io/code-book.

sort_by

How should the search result be sorted. By default, articles are sorted by date in descending order (newest items first).

sort_order

Sort order can be either ASC (ascending) or DESC (descending). The sort order is ignored if the search is sorted by (sort_by) _score.

results

Number of results to return

Sort

Articles can be sorted by:

Other metadata fields can be used for sorting, but search performance may be affected as only the fields mentioned above are currently indexed for sorting.

Examples

1
2
3
4
5
## Not run: 
newsriver_key("xXXxxXxXxXxx")
articles <- nr_search('language:en AND title:"New York"')

## End(Not run)

news-r/newsriver documentation built on June 10, 2019, 12:27 a.m.