asmith Posted August 1, 2008 Share Posted August 1, 2008 Hi A query such this : SELECT * FROM table WHERE MATCH(title,description) AGAINST('$_POST[key]') Almost finds everything. I have some telephone number recorded on the site. like 032344546. If i search for 32344546 (without 0 ), search finds nothing. If I use boolean mode, and search for 03234* it finds the number. But how can i tell it to find words that ends with the keyword ? How can I search for 23445 (in the middle) and find 032344546 with fulltext method?? (and so the same thing with words) Quote Link to comment Share on other sites More sharing options...
asmith Posted August 3, 2008 Author Share Posted August 3, 2008 Anyone help? The search in normal mode is not finding anything when they keywords is some characters in the middle of the word. Why it can't find it? I'm using this table structure : CREATE TABLE `table_name` ( `id` int( NOT NULL auto_increment, `title` varchar(200) default NULL, `description` text, `owner` varchar(50) default NULL, PRIMARY KEY (`id`), FULLTEXT KEY `title` (`title`), FULLTEXT KEY `description` (`description`), FULLTEXT KEY `owner` (`owner`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=25259 ; and this query : SELECT * FROM table WHERE MATCH(description) AGAINST('$_POST[key]') MySQL 5.0 Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted August 3, 2008 Share Posted August 3, 2008 have u tried using the LIKE command or % in the right spots? Quote Link to comment Share on other sites More sharing options...
asmith Posted August 4, 2008 Author Share Posted August 4, 2008 I don't want to use LIKE command as it won't show me my desired results.for several reasons, writing too much code...if i use a lot of words for the keywords it won't find anyting ... FULLTEXT search seems perfect for the result i want. I tried to use % in fulltext search, but that's not working too. I search for "comp" , it finds nothing. Which I want it to find computer. but the search for computer finds lots of results. I really want to use FULLTEXT search in normal mode, it seems it gives me the best results, but don't know how to solve such problem, been 2 days now, getting on my nerves :/ ATM this query is stlil giving the best results, including the problem i have with it : SELECT * FROM table WHERE MATCH(description) AGAINST('$_POST[key]') I want to find computer for the keywords like "omputer" . but won't find anything :/ Quote Link to comment Share on other sites More sharing options...
fenway Posted August 6, 2008 Share Posted August 6, 2008 What makes you think fulltext finds parts of words? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.