query-helpers: Helper functions for constructing the queries

Description Usage Arguments Details Value Examples

Description

Functions for constructing the query_params-argument of the fetch_notices()-function. Functions suffixed with _filter and _search use the respective functionalities of the Azure Cognitive Search.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29

Arguments

q1

First query

q2

Second query

is_dps

Whether to filter notices that are for DPSs or notices that are not for DPSs.

is_fa

Whether to filter notices that are for FAs or notices that are not for FAs.

is_national

Whether to filter notices that are for FAs or notices that are not for FAs.

notice_number

The notice number. E.g. "2020-000001".

id

The id of the procurement project. E.g. 1L.

since

A date-object. Includes the boundary and defaults to yesterday.

until

A date-object. Includes the boundary and defaults to today.

name

The name of the procuring organisation. E.g. "Hansel Oy".

organisation_id

The national registration id of the procuring organisation. E.g. "1234567-8".

cpv

The cpv code to search E.g. "00000000".

Details

query_and and _or can be used to combine queries (see example below).

Value

A list containing the query that can be passed to fetch_notices().

Examples

1
2
3
4
5
# A query that returns all notices modified 2020-01-01 or later
# from a certain organisation
q <- organisation_id_filter("1234567-8") %>%
query_and(all_notices_modified_since_filter(lubridate::ymd("2020-01-01")))
fetch_notices(q, api_key)

hansel-oy/hilma documentation built on Feb. 20, 2020, 3:20 a.m.