I do remember my old days when I am new to MySQL and Web industry. At that point of time whenever I have to implement search functionality I was used to implement it via LIKE keyword as below:
At that time I am not aware of full-text search. When I explore through Full-Text search I laugh at myself just because of silly stuff I was doing. I found Full-Text search is much powerful, efficient, faster and accurate way to present results of search query.
To perform Full-Text search you need to define indexing on required columns.
There are few constrain to use Full-Text search:
- Full-Text index can be used by MyISAM storage engine only
- Full-Text index can be defined on CHAR, VARCHAR and TEXT datatype only.
- Full-Text index is an index type of FULLTEXT
Basic syntax of full-text search function is:
in above, MATCH takes comma separated column’s name and AGAINT takes string to be searched.
There are three different types of full-text searches available in MySQL
- Boolean Search
- Natural Language Search
- Query Expansion Search
Pages: 1 2
