ajah / sks-interface

0 stars 0 forks source link

Adds custom sidebar filters #57

Closed psdcode closed 1 year ago

psdcode commented 1 year ago

Please do not merge until https://github.com/ajah/sks-interface/pull/53 is merged

Partly Resolves https://github.com/ajah/sks-interface/issues/10

@brittwitham @gustavohandrade Note: this PR will require changes to backend to accept new query parameter terms, eg: https://sks-server-ajah-ttwto.ondigitalocean.app/search?q=water&doctype=activity,entity&municipality=&operator=and&region=&terms=efc_climate%20education,efc_climate%20change

terms is composed of a list of terms prefixed by the category, in this case efc and separated from the actual sidebar search term option keyword by an underscore. The backend should take these terms, remove the category prefix, so in the above case climate%20education and climate%20change, convert the %20 to spaces , and then combine these terms in an AND way with the main search query terms from the q param, regardless whether the param operator is an OR or an AND for the words inside q, eg:

operator is OR: terms AND ( q1 OR q2 OR q2) operator is AND: terms AND ( q1 AND q2 AND q2)

As for the category prefix before the _, I'm not sure it's necessary on the backend, may be simply there for display/grouping purposes on the front end.

psdcode commented 1 year ago

@brittwitham , removed "do not merge" tag since you merged the previous one, and updated the initial comment with more info