I'm just learning to set up searchable tables, I apologize for any obtuse questions in advance. I've set up a table that will allow me to post messages to, seems to be working fine. I need to be able to search a particular column in the table in order to determine if a message is supposed to show up in a particular user's feed. This is my show create;
CREATE TABLE `feed` (
`messageid` int(11) unsigned NOT NULL AUTO_INCREMENT,
`userid` text,
`contactid` text,
`subject` text,
`message` text,
`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`flag` int(2) NOT NULL,
`state` int(2) NOT NULL,
`trash` int(2) NOT NULL,
PRIMARY KEY (`messageid`),
FULLTEXT KEY `contactid` (`contactid`),
FULLTEXT KEY `userid` (`userid`),
FULLTEXT KEY `message` (`message`),
FULLTEXT KEY `subject` (`subject`)
) ENGINE=MyISAM AUTO_INCREMENT=41 DEFAULT CHARSET=latin1
I believe the table type is set properly (MyISAM) and that any fields that I would want to be searchable have been set appropriately to text. Here is the full content of the table;
+-----------+--------+-----------+-----------------------------------------+--------------------------------------------+
| messageid | userid | contactid | subject | message |
+-----------+--------+-----------+-----------------------------------------+--------------------------------------------+
| 40 | 67 | 63 66 65 | Another test with apostraphes '''''' | ''' '''' ,,,, ''' ,,,' '''' test test test |
| 39 | 67 | 63 | Here's a test (with apostraphes '''''') | '''''' test test test ''''' |
+-----------+--------+-----------+-----------------------------------------+--------------------------------------------+
So, my thinking is to search the contactid column for a user's userid. If it shows up, the message will show up in the user's feed. But, when I do a search, nothing shows up;
mysql> select * from feed where match(contactid) against(63);
Empty set (0.00 sec)
Can someone help me figure out where I'm going wrong?