Menu


How to use MySQL Fulltext Search

If you want to search in the fields of a table using MySQL built in search functions and also order the results by relevancy computed by MySQL you can issue a query like this:


SELECT title, body, MATCH (body) AGAINST ('keyword1 keyword2') relevancy FROM tablename WHERE MATCH (body) AGAINST ('keyword1 keyword2') ORDER BY relevancy DESC


Note that the field must have FULLTEXT added.




MySQL categories


MySQL installation? MySQL configuration? MySQL Howtos MySQL troubleshooting?

Back to > Programming




Google Search

 
www.lacisoft.com
WWW
2009-2011 (c) Lacisoft.com