MySQL FullText Search

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

Moderator: General Moderators

Post Reply
User avatar
dibyendrah
Forum Contributor
Posts: 491
Joined: Wed Oct 19, 2005 5:14 am
Location: Nepal
Contact:

MySQL FullText Search

Post by dibyendrah »

Dear All,
I'm using MySQL FullText index for field which holds the large text. I tried the like query to search in this field and also used like conditions to test which is faster. Is the FullText Search better than like conditions or have their own benefits?

Regards,
Dibyendra
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

Much different than the 'like' operator full text searches are. Return a very different set of results for very different search criteria full text searches will.

ex:

with like:

'....where field like '%I am Yoda%''

return any string that contains 'I am Yoda' this will... return any string that contains 'I am neat and my name is Yoda' this will not.

with fti:

'....where match ('I am Yoda') against....'

return any string that contains 'I am Yoda' this will... return any string that contains 'I am neat and my name is Yoda' this might.

see the differenece?
User avatar
dibyendrah
Forum Contributor
Posts: 491
Joined: Wed Oct 19, 2005 5:14 am
Location: Nepal
Contact:

got some clue about full text search and implementing

Post by dibyendrah »

Hi Burrito,
I got some clue about full text in mysql from you and thanks for that. Anyway, I'll be back after having the detail look at manaul.

Dibyendra
AGISB
Forum Contributor
Posts: 422
Joined: Fri Jul 09, 2004 1:23 am

Post by AGISB »

If you got 1 table row with one large text the full text search will never get you anything. Only if you got many rows in the table you will get a result.

This is due to the fact that if mysql returns more than 50% of the rows in the search it renders it trivial. With one row you always get a trivial result.
Post Reply