search: Search

searchR Documentation

Search

Description

Search

Usage

hal_count(x, ...)

hal_search(x, ...)

## S3 method for class 'HALQuery'
hal_count(x, path = "search", ...)

## S3 method for class 'HALQuery'
hal_search(
  x,
  path = "search",
  limit = 30,
  start = 0,
  cursor = FALSE,
  parse = "df",
  concat = ",",
  progress = getOption("odyssey.progress"),
  verbose = getOption("odyssey.verbose"),
  ...
)

Arguments

x

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

...

Currently not used.

path

A character string specifying the url path (see details).

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".

parse

A character string specifying the type of the results. It must be one of "df" (default) or "list" (see solrium::SolrClient()).

concat

A character string specifying the character to concatenate elements of longer than length 1.

progress

A logical scalar: should a progress bar for for the request be printed? Only used if R is being used interactively.

verbose

A logical scalar: should extra information be reported?

Value

  • hal_count() returns the total number of results.

  • hal_search() returns a data.frame or list (according to type).

Author(s)

N. Frerebeau

References

Apache Solr documentation.

HAL search documentation.

HAL reference frame documentation.

See Also

Other search tools: hal_download()

Examples

## Not run: 
library(magrittr)

## Simple search
topic <- list("archéologie", "Celtes", "France") # Combined with AND
hal_api() %>%
  hal_query(topic) %>%
  hal_search(limit = 10)

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

## Get the most recent archaeological publication (in French) by journal
hal_api() %>%
  hal_query("archéologie") %>%
  hal_select("producedDate_tdate") %>%
  hal_filter("ART" %IN% "docType_s") %>%
  hal_sort("producedDate_tdate", decreasing = TRUE) %>%
  hal_group(
    field = "journalTitle_s",
    sort = "producedDate_tdate",
    decreasing = TRUE
  ) %>%
  hal_search(limit = 10)

## 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_api() %>%
  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/structure", limit = 15)

## End(Not run)

nfrerebeau/odyssey documentation built on March 30, 2022, 2:51 p.m.