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

solr_json_request

Solr json request


Description

search using the JSON request API

Usage

solr_json_request(conn, name = NULL, body = NULL, callopts = list(),
  progress = NULL)

Arguments

conn

A solrium connection object, see SolrClient

name

Name of a collection or core. Or leave as NULL if not needed.

body

(list) a named list, or a valid JSON character string

callopts

Call options passed on to crul::HttpClient

progress

a function with logic for printing a progress bar for an HTTP request, ultimately passed down to curl. only supports httr::progress for now. See the README for an example.

Value

JSON character string

Note

SOLR v7.1 was first version to support this. See https://issues.apache.org/jira/browse/SOLR-11244

POST request only, no GET request available

References

See https://lucene.apache.org/solr/guide/7_6/json-request-api.html for more information.

Examples

## Not run: 
# Connect to a local Solr instance
(conn <- SolrClient$new())

## body as JSON 
a <- conn$json_request("gettingstarted", body = '{"query":"*:*"}')
jsonlite::fromJSON(a)
## body as named list
b <- conn$json_request("gettingstarted", body = list(query = "*:*"))
jsonlite::fromJSON(b)

## body as JSON 
a <- solr_json_request(conn, "gettingstarted", body = '{"query":"*:*"}')
jsonlite::fromJSON(a)
## body as named list
b <- solr_json_request(conn, "gettingstarted", body = list(query = "*:*"))
jsonlite::fromJSON(b)

## End(Not run)

solrium

General Purpose R Interface to 'Solr'

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

We don't support your browser anymore

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