Open apricot13 opened 1 year ago
My understanding is that query parameters should be combined with a Boolean AND - so all filter conditions should be valid for all results.
So if you want to do an OR, you need to do two (or more) queries and combine the responses.
it is boolean AND.
/services?taxonomy_id=XXX&organization_id=YYY
So this is searching for taxonomy_id XXX AND organization_id YYY
Description of
request orchangeCurrently in Scout the filters work on
or
logic, this issue describes a request to add inAND
logic support as well.Original request:
Scope
This issue only covers filters, it does not cover taxonomies, see Caveats
User Story
As a user, I want to be able to request a list of services that have specific filters assigned to them. Specifically, I want to be able to filter services by the suitability tag, so that I can find services that are appropriate for my needs. Additionally, I want to be able to filter services by taxonomy tags, so that I can find services that are relevant to my interests.
Definition of Done
Acceptance Criteria
Using this data:
Scenario 1: Requesting a list of services with
suitability_1
ANDsuitability_2
assigned to themsuitability_1
ANDsuitability_2
assigned to them.Scenario 2: Requesting a list of services with
suitability_1
ORsuitability_2
assigned to themor
Then the API should return a list of services that have either
suitability_1
ORsuitability_2
assigned to them.Note: In all of the above scenarios, the API should return only the services that match the specified filter parameters. Any services that do not match the filters should be excluded from the results.
Notes
Looking into how ORUK uses taxonomies
It doesn't specify whether or not to default to 'AND' and 'OR' but it does seem to imply AND/OR, which is what Outpost currently supports.
Examples given here are:
finds services of types: 298 - Carers support groups and/or 1755 - Carers assessment.
finds services of types associated with circumstance Gender_Female - Female and/or AddictSubstanceAbuser_Smoking - Smoker.
finds services of types associated with needs 69 - Social inclusion and/or 71 - Community facilities
Caveats
Outpost doesn't currently support vocabularies but will do in the future so any solution should bear this in mind
In the ORUK standard when you request a list of services by taxonomy you must include three pieces of data (the taxonomy ID, the taxonomy type, and the vocabulary) in order to return a result
Tasks
filterCondition: and|or
on each filter box, and possibly a global option as wellFuture work