OpenReferralUK/human-services

Boolean operators in searches

Opened this issue · 0 comments

There's no clear guidance on how parameters are combined in API GET queries, but most are combined with a boolean AND.

There is a need to use a boolean OR in some circumstances, eg getting services with either of two taxonomy terms.

We'd like to suggest this syntax:
/services?taxonomy_id=esdServiceType:12&taxonomy_id=esdServiceType:13,14,15
for getting services of service type 12 AND (13, 14, or 15)

A simpler implementation would just be the second part using comma-separated values to support am OR operation.

The is approach could be applied to the "?need", "?circumstance" and "?serviceType" parameters supported by implementations designed ton work with these LGA vocabularies.