Skip to contents

Search

Usage

hal_search(query, ...)

# S3 method for class 'HALQuery'
hal_search(
  query,
  path = "search",
  instance = NULL,
  limit = 30,
  start = 0,
  cursor = FALSE,
  max_requests = 20,
  on_error = "stop",
  progress = getOption("odyssey.progress"),
  verbose = getOption("odyssey.verbose"),
  ...
)

Arguments

query

An object of class HALQuery (typically returned by hal_query()).

...

Currently not used.

path

A character string giving the API name (defaults to "search").

instance

A character string giving the HAL portal name.

limit

An integer giving the maximum number of results. According to HAL policy, it cannot exceed 10000.

start

An integer specifying an absolute offset in the complete sorted list of matches to be used as the beginning of the current page. Only used if cursor is FALSE.

cursor

A logical scalar: should a cursor be used for the pagination of results? If TRUE, the sort parameter of the query will set to "docid asc".

max_requests

An integer specifying the maximum number of requests to perform. Use Inf to perform all requests (see httr2::req_perform_iterative()). Only used if cursor is TRUE.

on_error

A character string specifying what should happen if a request fails (see httr2::req_perform_iterative()). Only used if cursor is TRUE.

progress

A logical scalar: should a progress bar for the request be printed?

verbose

A logical scalar: should extra information be reported?

Value

A list of class HALSearch.

See also

Other search tools: hal_count(), hal_download()

Author

N. Frerebeau

Examples

if (FALSE) { # \dontrun{
## Simple search
topic <- list("archéologie", "Celtes", "France") # Combined with AND
## Get the first ten results
hal_query(topic) |>
  hal_search(limit = 10) |>
  as.data.frame()
## Get all results
hal_query(topic) |>
  hal_search(limit = 30, cursor = TRUE) |>
  as.data.frame()

## Get a list of archaeological journals
topic <- c("archéologie", "archaeology", "archäologie") # Combined with OR
hal_query(topic) |>
  hal_select("title_s", "issn_s") |>
  hal_filter("" %TO% "*" %IN% "issn_s") |>
  hal_sort("title_s") |>
  hal_search(path = "ref", instance = "journal") |>
  as.data.frame()

## Get a list of archaeological laboratories
## (only joint laboratories of the CNRS and a French university)
topic <- list("archéologie" %IN% "text", "UMR" %IN% "code_t")
hal_query(topic) |>
  hal_select("name_s", "acronym_s", "code_s") |>
  hal_filter("VALID" %IN% "valid_s") |>
  hal_sort("acronym_s", decreasing = TRUE) |>
  hal_search(path = "ref", instance = "structure", limit = 15) |>
  as.data.frame()
} # }