Main Contents

Making a full text search with MySQL

general

I looked for a possiblity to add a full text search to my application without using lucene.

What I found was the FULLTEXT index of mysql.

In Detail it is described here. I provide you a short summary:

1. Create a fulltext index

ALTER TABLE entities ADD FULLTEXT KEY search_text (title);

2. Execute a select

SELECT id,title FROM entities WHERE  MATCH(title) AGAINST (’jazz’ IN BOOLEAN MODE);

jazzanowak @ July 7, 2009

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>


Feed