Skip to contents

deprecated in favor of `getTableAsRecords()`

Usage

esSearchPaged(
  indexName,
  searchBody = list(query = list(match_all = stats::setNames(list(), character(0)))),
  sort,
  totalSize = Inf,
  ...
)

Arguments

indexName

Name of ElasticSearch index (or wildcard pattern)

searchBody

search body, default will return all docs

sort

Sort argument passed onto elastic::Search. Defines which field the results are sorted by (best if this is unique for all docs to avoid ties) currently can only be one field and may not be '_id'.

totalSize
...

further arguments to elastic::Search, asdf argument does not work.

Value

ElasticSearch API response as a list

See also

`getTableAsRecords`

Examples

if (FALSE) { # \dontrun{
connectNtsportal()
res <- esSearchPaged("ntsp25.2_dbas*", searchBody = list(query = list(term = list(station = "mosel_ko_r"))), 
  source = c("name", "inchikey", "pol", "start", "duration", "area"), sort = "mz")

# Convert the returned list to a data.frame
temp <- lapply(res$hits$hits, function(x) as.data.frame(x[["_source"]]))
df <- plyr::rbind.fill(temp)
} # }