Initialize a query to the HAL API.
Value
A list
of class HALQuery
containing at least the following components:
q
(default to "
text:*
").fl
default to "
docid,label_s
").wt
(default to "
json
").
See also
Other query tools:
hal_facet()
,
hal_filter()
,
hal_group()
,
hal_select()
,
hal_sort()
,
operators
Examples
## Search for 'asie' in the 'text' field
hal_query("asie")
#> $q
#> [1] "text:asie"
#>
#> $fl
#> [1] "docid,label_s"
#>
#> $wt
#> [1] "json"
#>
#> attr(,"class")
#> [1] "HALQuery"
## Search for 'japon' and 'france' in the 'title_t' field
term <- list("japon", "france")
hal_query(term, field = "title_t")
#> $q
#> [1] "title_t:(japon AND france)"
#>
#> $fl
#> [1] "docid,label_s"
#>
#> $wt
#> [1] "json"
#>
#> attr(,"class")
#> [1] "HALQuery"
## Search for 'Journal', and 'Histoire' or 'History' in the 'title_t' field
term <- list("Journal", c("Histoire", "History"))
hal_query(term, field = "title_t")
#> $q
#> [1] "title_t:(Journal AND (Histoire OR History))"
#>
#> $fl
#> [1] "docid,label_s"
#>
#> $wt
#> [1] "json"
#>
#> attr(,"class")
#> [1] "HALQuery"