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 byhal_query()).- ...
Currently not used.
- field
A
characterstring specifying the field to group by.- limit
An
integergiving the maximum number of results per group.- sort
A
characterstring specifying the field to be used to sort the results.- prefix
A
characterstring.- contains
A
characterstring.- pivot
A
characterstring.- range
A
listcontaining the following components: "range", "start", "end", "gap".- ignore_case
A
logicalscalar: 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
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()
} # }