from_size_search: Execute query with from-size search API.

Description Usage Arguments Value See Also Examples

View source: R/utils.R

Description

The from-size search API allows a maximum of 10,000 search results (the maximum 'size') to be returned in one call to the API. The 'from' in the name of the API refers to where in the order of all qualifying documents (as ordered by their search score), should results start to be returned from. Anything larger than 10,000 and the results need to be fetched from using the scroll-search API (which is slower as it involves making multiple call-back requests). This API is particularly well suited to returning aggregation results.

Usage

1
from_size_search(rescource, api_call_payload)

Arguments

rescource

An elastic rescource object describing on what documents the query is to be execured on.

api_call_payload

A character string containing the JSON payload that described the query to be executed.

Value

A data.frame of documents returned from the query.

See Also

https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-from-size.html for more information on the information required by the Elasticsearch from-size API.

Examples

 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 <- from_size_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)

AlexIoannides/elasticsearchr documentation built on July 31, 2019, 9:36 a.m.