Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

msearch

Multi-search


Description

Performs multiple searches, defined in a file

Usage

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

Arguments

conn

an Elasticsearch connection object, see connect()

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 crul::verb-POST

Details

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

See Also

Examples

## Not run: 
x <- connect()

msearch1 <- system.file("examples", "msearch_eg1.json", package = "elastic")
readLines(msearch1)
msearch(x, msearch1)

tf <- tempfile(fileext = ".json")
cat('{"index" : "shakespeare"}', file = tf, sep = "\n")
cat('{"query" : {"match_all" : {}}, "from" : 0, "size" : 5}',  sep = "\n",
   file = tf, append = TRUE)
readLines(tf)
msearch(x, tf)

## End(Not run)

elastic

General Purpose Interface to 'Elasticsearch'

v1.2.0
MIT + file LICENSE
Authors
Scott Chamberlain [aut, cre] (<https://orcid.org/0000-0003-1444-9135>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.