Skip to contents

Select Fields

Usage

hal_select(query, ...)

# S3 method for class 'HALQuery'
hal_select(query, ...)

Arguments

query

An object of class HALQuery (typically returned by hal_query()).

...

One or more character string separated by commas giving the fields to be returned.

Value

An object of class HALQuery.

See also

Other query tools: hal_facet(), hal_filter(), hal_group(), hal_query(), hal_sort(), operators

Author

N. Frerebeau

Examples

## Select fields
hal_query() |> hal_select("label_s")
#> $q
#> [1] "text:*"
#> 
#> $fl
#> [1] "label_s"
#> 
#> $wt
#> [1] "json"
#> 
#> attr(,"class")
#> [1] "HALQuery"

(q <- hal_query() |> hal_select("halId_s", "uri_s"))
#> $q
#> [1] "text:*"
#> 
#> $fl
#> [1] "halId_s,uri_s"
#> 
#> $wt
#> [1] "json"
#> 
#> attr(,"class")
#> [1] "HALQuery"

## Update query
hal_select(q, "docType_s")
#> $q
#> [1] "text:*"
#> 
#> $fl
#> [1] "docType_s"
#> 
#> $wt
#> [1] "json"
#> 
#> attr(,"class")
#> [1] "HALQuery"