sustainability-zhaw / sustainability-dashboard

Frontend for the ZHAW Sustainability Dashboard
MIT License
0 stars 1 forks source link

SDGs and Deptartments should be AND connected #23

Closed phish108 closed 1 year ago

phish108 commented 1 year ago

if two SDG or departments are used in the same search, the MUST be cooccurring and not individually.

Question: What would the most common connector? AND or OR.

When using cooccurrence with "AND", the in operator will be used as a singleton operator and is then connected with an and operator.

idea:

...

sdg(filter: {
    and: [ 
        { id:  in: [ "3" ] },
        { id:  in: [ "7" ] }
    ]
]) {
    id 
}

...

We should use and explicitly, despite the fact that and is default. the reason is, that it is more readable about what is happening and it is better to express in JSON.

phish108 commented 1 year ago

Decision today was:

The first bullet needs to get fixed now, the second bullet should be a refinement in a second stage.

The code of all queries must be changed to:

sdg(filter: {
    and: [ 
        { id:  eq: "3" },
        { id:  eq: "7" }
    ]
]) {
    id 
}

Same as for departments.

This changes the initial meaning of the search box. If two SDGs are entered, then this means that all InfoObjects that were marked for both SDGs are included in the search result.