Hi Folks
This might be helpful to those getting funky with searches....
SCENARIO
Searching for articles where some value is stored in a custom_field as comma separated values i.e.
Article 1:
id: 123
custom_field: a,b,c<br>
Article 2:
id: 234
custom_field: b,c,d<br>
So in search form, have a field...
type: select (dynamic or simple etc)
storage: custom_field
options: first=a,second=b, etc (or have options based on db query etc)
So now search field is set up to allow user to search for articles based on values stored in ‘custom_field’.
MATCH
We need to alter the fields 3/Match setting.
Getting your head round Match is really important.
With 3/Match selected:
- Change custom_field to ‘any words exact’. It was probably on ‘permissive (default).
- With ‘any words exact’ selected, click the cross (+) next to it to reveal modal window.
- There will be a couple of things to choose from.
- All we are interested in is changing Comparison Mode from ‘Simple’ to ‘Multiple’.
- Compare the SQL query before and after using debug (found in template's configuration area)