Skip to contents

Facet Search

Usage

hal_facet(query, ...)

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

Arguments

query

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

...

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(), operators

Author

N. Frerebeau

Examples

if (FALSE) { # \dontrun{
## Get the number of archaeological document by journal
hal_query("archéologie") |>
  hal_facet(field = "journalTitle_s", sort = "count", decreasing = TRUE) |>
  hal_search()

## Get the number of documents per year
hal_query("archéologie") |>
  hal_facet(
    sort = "count",
    range = list(
      field = "producedDateY_i",
      start = 2000,
      end = 2020,
      gap = 1
    )
  ) |>
  hal_search()
} # }