This function retrieves records from the Finna index with an option to limit the total number of records returned. The function paginates through the results, fetching records until the specified total limit is reached.
search_finna(
query = NULL,
type = "AllFields",
fields = NULL,
filters = NULL,
facets = NULL,
facetFilters = NULL,
sort = "relevance,id asc",
limit = 100,
lng = "fi",
prettyPrint = FALSE
)A tibble containing the search results with relevant fields extracted and provenance information.
description
A string specifying the type of search. Options include "AllFields", "Title", "Author", "Subject". Defaults to "AllFields".
A vector of fields to be returned in the search results. Defaults to NULL, which returns a standard set of fields.
A vector of filter queries to refine the search. Defaults to NULL.
A vector specifying which facets to return in the results. Defaults to NULL.
A vector of regular expressions to filter facets. Defaults to NULL.
A string defining the sort order of the results. Options include:
"relevance,id asc" (default)
"main_date_str desc" (Year, newest first)
"main_date_str asc" (Year, oldest first)
"last_indexed desc" (Last modified)
"first_indexed desc" (Last added)
"callnumber,id asc" (Classmark)
"author,id asc" (Author)
"title,id asc" (Title)
An integer specifying the total number of records to return across multiple pages.
A string for the language of returned translated strings. Options are "fi" - Finnish, "en-gb" - English, "sv" - Swedish, "se" - Sami. Defaults to "fi" - Finnish.
A logical value indicating whether to pretty-print the JSON response. Useful for debugging. Defaults to FALSE.
search_results <- search_finna("sibelius", sort = "main_date_str desc", limit = 100)
print(search_results)
Run the code above in your browser using DataLab