Tuesday, March 28, 2006

Return better results using full-text search in MySQL

Many Web applications offer full-text search capabilities, wherein the user can locate matching records by using a word or word fragment as the query term. Behind the scenes, these applications are often performing this search by using a LIKE clause in a SELECT query. While this certainly works, it is an extremely inefficient way of performing a full-text search, especially with large volumes of data.
MySQL offers a solution to this problem, in the form of built-in full-text search. Here, the developer need simply mark certain fields as needing full-text search, and then use special MySQL functions to run searches on those fields. This is not only more performance-efficient (because MySQL indexes these fields differently to optimize the search) but also results in higher-quality searches, because MySQL intelligently ranks the results using a natural-language algorithm to remove irrelevant items.
This document will show you how to perform full-text searches in MySQL

No comments:

Post a Comment