It is a little bit complicated but you can resolve the trouble.
First of all, you need to use the cftsearch shortcode with the format attribute like [cftsearch format=0]
not just [cftsearch]
.
There are several attributes for the search option. searchType
is the type of the search fields. searchValue
is the value of the search fields. The most important attribute for you is searchOperator
. The default operator of the search SQL is LIKE '%blah%'
. So it is impossible to distinguish no
and unknown
. You can change the operator. If you set =
as the value of searchOperator
, you can get the results you want. Please be careful that these values must be an array.
Finally, you need to add the first array element of searchType
,searchValue
, and searchOperator
in the cftsearch format. The first array element number is 1. In the cftsearch format, [keyname] will be converted to the default search field. It is same as [keyname][0]. If you set [keyname][1], the first search array element you set will be loaded.
It is hard to explain the detail. It is the best way to see the example:
Template Content: #0
[keyname]
type = select
value = yes # no # unknown
searchType = array('select');
searchValue = array('yes # no # unknown');
searchOperator = array('=');
[cft] and [cftsearch] Shortcode Format]: #0
keyname: [keyname][1]
Please use the latest version of this plugin. Let me know if you have any questions. Thanks.