Learn R Programming

boxr (version 0.3.6)

box_search: Search Box files

Description

Search Box files

Usage

box_search(
  query = "",
  content_types = c("name", "description", "file_content", "comments", "tags"),
  type = NULL,
  file_extensions = NULL,
  ancestor_folder_ids = NULL,
  created_at_range = NULL,
  updated_at_range = NULL,
  size_range = NULL,
  trash = FALSE,
  owner_user_ids = NULL,
  max = 200
)

box_search_files(query, ...)

box_search_folders(query, ...)

box_search_trash(query, ...)

Arguments

query

character, search term.

content_types

character, content to search; more than one can be supplied with a vector.

type

character, type of object to return; the default, NULL, returns all possible types ("file", "folder", or "weblink").

file_extensions

character, vector of strings containing the file extensions (without dots) by which to narrow your search.

ancestor_folder_ids

numeric or character, if supplied, results are limited to one or more parent (ancestor) folders.

created_at_range

POSIXct (vector, length 2), range of created-at times.

updated_at_range

POSIXct (vector, length 2), range of updated-at times.

size_range

numeric (vector, length 2), range of file sizes (bytes).

trash

logical, indicates to search only the trash folder.

owner_user_ids

numeric or character, limits search to files owned by users with these IDs.

max

numeric, upper limit on the number of search results.

...

Other arguments passed to box_search().

Value

Object with S3 class boxr_object_list.

Details

The Box API supports a maximum of 200 results per request. If max > 200, then multiple requests will be sent to retrieve and combine 'paginated' results for you, behind the scenes.

See the box.com search description for details of the features of the service. Some notable details:

  • Full-text searching is the default

    • available for many source code file types, but not R scripts.

    • by default Box seaches by word/token and uses the OR operation e.g. box_search("this that") is equivilant to box_search("this OR that")

  • Reserved words for boolean operations

    • AND, OR, and NOT (uppercase only) are interpreted as special context e.g. box_search("NOT this"), box_search("this AND that")

  • Exact phrases can be matched

    • by surrounding them with double quotation marks e.g. box_search('"this exact phrase"') or box_search("\"this exact phrase\"")

  • Searchability is not instantaneous

    • it can take >10 minutes for a newly uploaded file to become findable