This class handles the storage and manipulation of search results including downloading resources based on a search query.
SearchResults
results
Stores the search results data.
total_count
Stores the total count of results' element.
total_size
Stores the total size of results
new()
Initializes a new SearchResults object with the specified client, results, and dataset identifier.
SearchResults$new(client, results, dataset_id)
client
An object containing the API client used to interact with the dataset.
results
List containing search results.
dataset_id
The identifier for the dataset being queried.
SearchResult instance
download()
Downloads resources based on stored results or selected indices of results.
SearchResults$download(
output_dir,
selected_indexes,
stop_at_failure = TRUE,
force = FALSE,
prompt = TRUE
)
output_dir
A string specifying the directory where downloaded files will be saved.
selected_indexes
Optional; indices of the specific results to download.
stop_at_failure
Optional; controls whether the download process of multiple files should immediately stop upon encountering the first failure.
force
Optional; forces the download even if the file already exists in the specified output directory.
prompt
Optional; enables all user prompts for decisions during file downloads. Defaults to true.
Nothing returned but downloaded files are saved at the specified location.
clone()
The objects of this class are cloneable with this method.
SearchResults$clone(deep = FALSE)
deep
Whether to make a deep clone.