| search_items | R Documentation |
Perform full text search or use parameters to programamatically query your portal for content items.
search_items(
query = NULL,
filter = NULL,
title = NULL,
description = NULL,
snippet = NULL,
tags = NULL,
owner = NULL,
orgid = NULL,
item_type = NULL,
type_keywords = NULL,
created = NULL,
modified = NULL,
categories = NULL,
category_filters = NULL,
sort_field = NULL,
sort_order = NULL,
count_fields = NULL,
count_size = NULL,
display_sublayers = FALSE,
filter_logic = "and",
bbox = NULL,
page_size = 50,
max_pages = Inf,
.progress = TRUE,
host = arc_host(),
token = arc_token()
)
query |
a scalar character for free text search or a valid query string as defined by the REST API. |
filter |
a scalar character. If provided all other arguments except query are ignored. |
title |
optional character vector of content item titles. |
description, snippet |
optional scalar character of text to check for. |
tags |
optional character vector of tags to search for. |
owner |
optional character vector of owner usernames to search for. |
orgid |
optional character vector of organization IDs to search for. |
item_type |
optional character vector of content item types. Validated with |
type_keywords |
optional character vector of content tpye keywords. Validated with |
created, modified |
optional length two vector which must be coercible to a date time vector. Converted using |
categories |
optional character vector of up to 8 organization content categories. |
category_filters |
optional character vector of up to 3 category terms. Items that have matching categories are returned. Exclusive with |
sort_field |
optional character vector of fields to sort by. Can sort by |
sort_order |
optional string. One of either |
count_fields |
optional character vector of up to 3 fields to count. Must be one of |
count_size |
optional integer determines the maximum number of field values to count for each counted field in |
display_sublayers |
default |
filter_logic |
default |
bbox |
unimplemented. |
page_size |
a scalar integer between 1 and 100 indicating the number of responses per page. |
max_pages |
the maximum number of pages to fetch. By default fetches all pages. |
.progress |
default |
host |
default |
token |
an object of class |
Search is quite nuanced and should be handled with care as you may get unexpected results.
Most arguments are passed as filter parameters to the API endpoint.
If multiple values are passed to an argument such as tags, the search will use an "OR" statement.
When multiple arguments are provided, for example tags, owner, and item_type, the search will use "AND" logic—i.e. results shown match the tags and owner and item_type.
Note: you can change this to "OR" behavior by setting filter_logic = "or"
If the filter argument is provided, all other arguments except query are ignored.
a data.frame.
crime_items <- search_items(
query = "crime",
item_type = "Feature Service",
max_pages = 1
)
crime_items
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.