@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®ion=&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.
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®ion=&terms=efc_climate%20education,efc_climate%20change
terms
is composed of a list of terms prefixed by the category, in this caseefc
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 caseclimate%20education
andclimate%20change
, convert the%20
to spaces , and then combine these terms in anAND
way with the main search query terms from theq
param, regardless whether the paramoperator
is anOR
or anAND
for the words insideq
, eg:operator
isOR
:terms AND ( q1 OR q2 OR q2)
operator
isAND
: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.