Jump to content

Does indexing a longtext field help with text searches?


benphp

Recommended Posts

While I was waiting, I did some testing. OMYGOD what have I been missing?

 

For anyone who hasn't done this, index your long text tables so:

 

ALTER TABLE `tablename` ADD FULLTEXT (textfield1);

ALTER TABLE `tablename` ADD FULLTEXT (textfield2);

 

then change your select statements from

 

WHERE textfield1 LIKE '%$term%'

 

to

 

WHERE MATCH (textfield1) AGAINST ('$term')

 

What a difference!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.