build_gov_query: Build Gov Query

Description Usage Arguments Examples

View source: R/search_api_funs.r

Description

A function designed to make it simple to build query urls for the search API

Usage

1
2
3
4
5
6
7
8
9
build_gov_query(
  q = "",
  count = 10,
  start = 0,
  order = "-popularity",
  org_any = NULL,
  org_all = NULL,
  fields = NULL
)

Arguments

q

query string

count

(single integer) Maximum number of search results to return. If insufficient documents match, as many as possible are returned (subject to the supplied start offset). This may be set to 0 to return no results (which may be useful if only, say, facet values are wanted). Setting this to 0 will reduce processing time.

start

(single integer) Position in search result list to start returning results (0-based) If the start offset is greater than the number of matching results, no results will be returned (but also no error will be returned).

order

(single string) The sort order. A field name, with an optional preceding "-" to sort in descending order. If not specified, sort order is relevance. Only some fields can be sorted on - an HTTP 422 error will be returned if the requested field is not a valid sort field.

org_any

list of organisation names to filter to. returns results if _any_ of the organisations match

org_all

list of organisation names to filter to. returns results if _all_ of the organisations match

fields

a vector of field names to return. See https://docs.publishing.service.gov.uk/apis/search/fields.html

Examples

1

mattmalcher/gov.uk.taxonomy documentation built on Jan. 25, 2020, 12:45 a.m.