Description Usage Arguments Value See Also Examples
View source: R/elasticsearchr_utils.R
The scroll-search API works by returning a 'token' to the user that allows search results to be returned one 'page' at a time. This, large query results (in excess of the 10,000 documents maximum size offered by the from-search API) can be retreived by making multiple calls after the initial query was sent. Although a slower process end-to-end, this API is particularly well suited to returning large query results.
| 1 2 3 4 5 | scroll_search(
  rescource,
  api_call_payload,
  extract_function = extract_query_results
)
 | 
| rescource | An  | 
| api_call_payload | A character string containing the JSON payload that described the query to be executed. | 
| extract_function | A function to be used for extracting the data from the responses sent
back from the scroll-search API. Defaults to  | 
A data.frame of documents returned from the query.
https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-scroll.html for more information on the information required by the Elasticsearch scroll-search API.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ## Not run: 
elastic_rescource <- elastic("http://localhost:9200", "iris", "data")
query_json <- '{"query": {"match_all": {}}}'
results <- scroll_search(elastic_rescource, query_json)
head(results)
#   sepal_length sepal_width petal_length petal_width species
# 1          4.8         3.0          1.4         0.1  setosa
# 2          4.3         3.0          1.1         0.1  setosa
# 3          5.8         4.0          1.2         0.2  setosa
# 4          5.1         3.5          1.4         0.3  setosa
# 5          5.2         3.5          1.5         0.2  setosa
# 6          5.2         3.4          1.4         0.2  setosa
## End(Not run)
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.