Skip to contents

Initialize a query to the HAL API.

Usage

hal_query(value = "*", field = "text", ...)

Arguments

value

A vector giving the topics to be searched for (see details).

field

A character string specifying the field to search within.

...

Currently not used.

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

Author

N. Frerebeau

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"