search_finna {finna} | R Documentation |
Finna Index Search with Total Limit Option
Description
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.
Usage
search_finna(
query = NULL,
type = "AllFields",
fields = NULL,
filters = NULL,
facets = NULL,
facetFilters = NULL,
sort = "relevance,id asc",
limit = 100,
lng = "fi",
prettyPrint = FALSE
)
Arguments
query |
description |
type |
A string specifying the type of search. Options include "AllFields", "Title", "Author", "Subject". Defaults to "AllFields". |
fields |
A vector of fields to be returned in the search results. Defaults to NULL, which returns a standard set of fields. |
filters |
A vector of filter queries to refine the search. Defaults to NULL. |
facets |
A vector specifying which facets to return in the results. Defaults to NULL. |
facetFilters |
A vector of regular expressions to filter facets. Defaults to NULL. |
sort |
A string defining the sort order of the results. Options include:
|
limit |
An integer specifying the total number of records to return across multiple pages. |
lng |
A string for the language of returned translated strings. Options are "fi" - Finnish, "en-gb" - English, "sv" - Swedish, "se" - Sami. Defaults to "fi" - Finnish. |
prettyPrint |
A logical value indicating whether to pretty-print the JSON response. Useful for debugging. Defaults to FALSE. |
Value
A tibble containing the search results with relevant fields extracted and provenance information.
Examples
search_results <- search_finna("sibelius", sort = "main_date_str desc", limit = 100)
print(search_results)