Description Usage Arguments Details Examples
Get documents by id
1 |
conn |
A solrium connection object, see SolrClient |
ids |
Document IDs, one or more in a vector or list |
name |
(character) A collection or core name. Required. |
fl |
Fields to return, can be a character vector like
|
wt |
(character) One of json (default) or xml. Data type returned.
If json, uses |
raw |
(logical) If |
... |
curl options passed on to crul::HttpClient |
We use json internally as data interchange format for this function.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ## Not run:
(cli <- SolrClient$new())
# add some documents first
ss <- list(list(id = 1, price = 100), list(id = 2, price = 500))
add(cli, ss, name = "gettingstarted")
# Now, get documents by id
solr_get(cli, ids = 1, "gettingstarted")
solr_get(cli, ids = 2, "gettingstarted")
solr_get(cli, ids = c(1, 2), "gettingstarted")
solr_get(cli, ids = "1,2", "gettingstarted")
# Get raw JSON
solr_get(cli, ids = 1, "gettingstarted", raw = TRUE, wt = "json")
solr_get(cli, ids = 1, "gettingstarted", raw = TRUE, wt = "xml")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.