bill, thanks for the advice however im just now noticing that the argument for against(...) may not be a variable - it must be a constant string. let me refine this question a bit...
tables:
corpuses CREATE TABLE `corpuses` (
`source-id` int(11) unsigned NOT NULL,
`title` text collate utf8_bin NOT NULL,
`body` text collate utf8_bin NOT NULL,
PRIMARY KEY (`source-id`),
FULLTEXT KEY `NewIndex1` (`title`,`body`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC
searches CREATE TABLE `searches` (
`id` int(11) unsigned NOT NULL auto_increment,
`user-id` int(11) NOT NULL,
`source-id` int(11) NOT NULL,
`term` varchar(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1
given that the argument for against(...) must be a literal what would be an efficient way of comparing all of searches.terms with all of corpuses.title and corpuses.body and returning user-id along with title and body?
i realize that this is complex operation with several different problems going on at once, so advice regarding individual portions of the whole problem is still hugely appreciated.
additionally, the searches column is likely to be very very large and corpuses table is likely to remain very very small, albeit will be updated very frequently.
i really would like to avoid having to programatically iterate over each term in searches. any thoughts?
thanks again
brian
update - the query that returns the data that i am interested in is of the following form:
select `user-id`, `title`, `body` from corpuses, searches where ( (match(corpuses.title, corpuses.body) against ('search term')) and `user-id`=uid);
now what i need to do is figure out how to make this efficient assuming that i will need to execute it for many many combinations of search-term
and uid
.
also, it seems that stored procedures are out of the question since you cannot pass a variable into against.