snoopy6129
MIS
I have built a product search feature for a website I am working on. The search feature works. But I would like to enhance it. Right now, for example, if someone where to enter the keyword duck in my 'product search engine', only records that has the exact spelling of duck are displayed. What I would like to do to enhance the search engine is to have it display records that also contains the word ducks (plural) or murduck, etc.
The SQL statement I've come up with (below) does not work as I would expect it. I've used both the % and the * as the wildcard operator. Still, only records with the exact spelling of duck are returned.
Essentially, I'm trying to accomplish this:
but across multiple fields.
I am running MySQL 3.23.58 and from the various sites I've visited, this may not be possible. Please advise, suggestions, or if this is possible on MySQL 3.23.58, or if my syntax is wrong, etc.
Thank you all in advance.
The SQL statement I've come up with (below) does not work as I would expect it. I've used both the % and the * as the wildcard operator. Still, only records with the exact spelling of duck are returned.
Code:
SELECT *
FROM Products
WHERE MATCH (ProductItemNumber, ProductName, ProductDescription)
AGAINST ('%duck%')
Essentially, I'm trying to accomplish this:
Code:
SELECT * FROM Products WHERE ProductName LIKE '%duck%'
I am running MySQL 3.23.58 and from the various sites I've visited, this may not be possible. Please advise, suggestions, or if this is possible on MySQL 3.23.58, or if my syntax is wrong, etc.
Thank you all in advance.