Full-Text Queries

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
dunc
Forum Newbie
Posts: 13
Joined: Mon Sep 04, 2006 10:17 am

Full-Text Queries

Post by dunc »

Hey..

I have been using:

Code: Select all

SELECT *
FROM table
WHERE condition = x
For example, taken from my post at viewtopic.php?t=54922, this long line of SQL:

Code: Select all

"SELECT *
FROM profile
WHERE commonName LIKE '%$search%'
  AND species LIKE '%$searchSpecies%'
  AND genus LIKE '%$searchGenus%'
  AND category LIKE '$searchCatInp%'";
I've been told that's a very inefficient and slow method of searching - and to be fair, when we have nearly 1000 profiles, a search does seem to take a few seconds.

Is there a better way of doing that search using SQL's FULLTEXT command?

Regards,
Dunc
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Re: Full-Text Queries

Post by feyd »

dunc wrote:Is there a better way of doing that search using SQL's FULLTEXT command?
yes.
Post Reply