Full-text searching is ideal for extremely large databases that contain thousands or even millions of rows. Computations are performed faster and rows can be ranked based on search relevance, which is returned as a decimal number by MySQL.
Noise words and any words that are 3 characters or less in length such as the, and, etc are removed from the search query. This means that more accurate results are returned. If you searched for “as the people”, then the noise words “the” and “as” will automatically be removed from your query.
In addition to simple searches, full-text searches can also be performed in Boolean mode. Boolean mode allows searches based on and/or criteria, such as “+person +Mitchell”, which would only return all records that contained the words person AND Mitchell. We will look at Boolean searches later in this article.
The query is case-insensitive, meaning that “cat” is ranked the same as “Cat”, “CAT” and “cAT”.
full-text searching is fast, powerful and smart
Fulltext search classifieds by two types.
Its have some restrictions.
Natural Language Search:
✔ MATCH (col1, col2, …) AGAINST (“query phrase”
[ WITH QUERY EXPANSION ] )
✔ is supposed to find documents (rows) that are about the topic
described in the query phrase
✔ the query is a phrase in natural human language (e.g. English)
How to achieve this
1) We need to add fulltext index in table using fulltext command it can be achieved by two ways.
CREATE TABLE articles ( id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY, title VARCHAR(200), body TEXT, FULLTEXT (title,body) );
OR
2) Then invoke the command in MATCH… AGAINST…
Thats it. Now your search perform faster manner.
We will discuss boolean and Full text search internal in my next blog.