Facet Search

hal_facet(x, ...)

# S3 method for HALQuery
hal_facet(
  x,
  field,
  limit = 5,
  sort = c("index", "count"),
  prefix = NULL,
  contains = NULL,
  pivot = NULL,
  range = NULL,
  ignore_case = FALSE,
  ...
)

Arguments

x

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

...

Currently not used.

field

A character string specifying the field to group by.

limit

An integer giving the maximum number of results per group.

sort

A character string specifying the field to be used to sort the results.

prefix

A character string.

contains

A character string.

pivot

A character string.

range

A list containing the following components: "range", "start", "end", "gap".

ignore_case

A logical scalar: should character case be ignored?

Value

An object of class HALQuery.

See also

Other query tools: hal_filter(), hal_group(), hal_query(), hal_select(), hal_sort()

Author

N. Frerebeau

Examples

if (FALSE) {
library(magrittr)

## Most recent publication by journal
hal_api() %>%
  hal_query("archéologie") %>%
  hal_facet(
    field = "docType_s",
    limit = 100,
    sort = "count",
    range = list(
      range = "producedDateY_i",
      start = 2000,
      end = 2020,
      gap = 1
    )
  ) %>%
  hal_search(limit = 10)
}