Posted by Russ
2016-09-07

Hi Tom,

Me again!

How do I make the search on some fields "exact"?

For instance I have a field called "District" and acceptable values are 1 - 25.

If I search on "2" I get 2, 20, 21, 22, 23, 24, and 25 - as they all contain "2".

Can I force the search to only find the exact search statement?

Thanks in advance

Russ
Posted by Tom
2016-09-09

To make the search on a field "exact", first open web/codelib/asc/df.fl.(table-name).inc.php and find the field definition array. The example below is for the first_name field.
'first_name'=>array(
XA_CLASS=>'CVText',
XA_REQUIRED=>false,
XA_SIZE=>36,
XA_MIN_CHAR=>0,
XA_MAX_CHAR=>100,
XA_SEARCH_OP=>'s%',
XA_LIST=>'(sp)(sr)(fd)',
),
Replace s% with s= in the line
XA_SEARCH_OP=>'s%',
The result should look like
XA_SEARCH_OP=>'s=',