msearch: Multi-search

Description Usage Arguments Details See Also Examples

View source: R/msearch.R

Description

Performs multiple searches, defined in a file

Usage

1
msearch(x, raw = FALSE, asdf = FALSE, ...)

Arguments

x

(character) A file path

raw

(logical) Get raw JSON back or not.

asdf

(logical) If TRUE, use jsonlite::fromJSON() to parse JSON directly to a data.frame. If FALSE (Default), list output is given.

...

Curl args passed on to httr::POST()

Details

This function behaves similarly to docs_bulk() - performs searches based on queries defined in a file.

See Also

Search_uri() Search()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
connect()
msearch1 <- system.file("examples", "msearch_eg1.json", package = "elastic")
readLines(msearch1)
msearch(msearch1)

cat('{"index" : "shakespeare"}', file = "~/mysearch.json", sep = "\n")
cat('{"query" : {"match_all" : {}}, "from" : 0, "size" : 5}',  sep = "\n",
   file = "~/mysearch.json", append = TRUE)
msearch("~/mysearch.json")

## End(Not run)

ropensci/elastic documentation built on Dec. 17, 2018, 11:08 a.m.