Search button does not search INT field
Archived from the Xataface Users forum.
rleyba — Tue May 31, 2011 5:21 am
Hi Steve,
One of my Xataface tables has the schema below. Everything seems to work except that when I click the search button on the page, it does NOT seem to search the VlanID field which is integer. The FIND button finds it though. Example, if I type 465 in the Search button and click Submit….nothing shows up…but if I go to FIND….then under VLANID type in 465, then it shows the relevant rows. How do we change the behaviour of the Search bar so it can search integers too?
I have the same experience with the Mask field, which is also an integer.
Thanks very much.
- Code: Select all
CREATE TABLE IF NOT EXISTS `FIREWALL_INTERFACES` ( `Firewall_Name` varchar(15) NOT NULL, `Logical_Interface` varchar(15) NOT NULL, `VlanID` int(4) NOT NULL, `Active` char(3) NOT NULL, `link_avail` varchar(7) NOT NULL, `Type` varchar(22) NOT NULL, `IP_Address` char(15) NOT NULL, `Mask` int(3) NOT NULL, PRIMARY KEY (`Firewall_Name`,`Logical_Interface`,`VlanID`,`Active`,`link_avail`,`Type`,`IP_Address`,`Mask`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
shannah — Tue May 31, 2011 9:17 am
Yes. The search in the upper right produces the -search GET parameter. This matches only char, varchar, and text fields. The find form allows more precise searches on particular fields.
-Steve
rleyba — Wed Jun 01, 2011 1:33 am
Ok, thanks….will change the field type.
shannah — Mon Jun 06, 2011 1:37 pm
An alternative to changing the field type is to add a grafted field that is searchable. Sometimes I’ll create a concatenated field on a table for the sole purpose of searching … then I hide the field from all of my views.
E.g. fields.ini
- Code: Select all
- `sql = “select a.*, concat(a.field1,’ ‘,a.field2,’ ‘,a.field3) as search_field from atable a”
[search_field]
visibility:list=hidden
visibility:browse=hidden
visibility:find=hidden`