Fulltext search problem

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

user___
Forum Contributor
Posts: 297
Joined: Tue Dec 05, 2006 3:05 pm

Reply

Post by user___ »

Sorry, it was a mistake(I have chosen "One" in between five hundred thousand English words). I appologize about that. You are right it works with other words but now it does not work when there are more than one word in box.
What is the matter?
I use the same table with this data:
id|title|user_id
1|Prime|1
2|Minister is fine|39
3|Hello to everyone|3

It works with "Prime" but with others two does not.
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

These queries work fine for me with that data:

Code: Select all

select * from news where match(title) against ('Minister');
select * from news where match(title) against ('Minister fine');
select * from news where match(title) against ('Minister fine is');
1 row returned in all cases.

Create table syntax:

Code: Select all

CREATE TABLE `news` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `title` varchar(39) NOT NULL,
  `user_id` int(10) unsigned NOT NULL,
  PRIMARY KEY  (`id`),
  FULLTEXT KEY `title` (`title`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
user___
Forum Contributor
Posts: 297
Joined: Tue Dec 05, 2006 3:05 pm

Reply

Post by user___ »

Thank you guys. If you had not helped me, I would have not succeeded in solving that problem.

I think that the main problem was that all the tables had been in InnoDB before I decided to change them to MyISAM and I got this problem. The solution is:
Drop your tables and then recreate them in MyISAM(Update seems not to work properly).
Never use stop words for test tables.
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

Good to hear.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Post Reply