Soldato
- Joined
- 24 Sep 2007
- Posts
- 5,180
Hi Guys
I am looking for some general advice on how to do a meaningful text phrase search on a MySQL database. I have a database full of text descriptions for shopping products, and I want to build a search function against the database that is as useful as possible.
Let's say I have the search term "green mens jumper".
So far, I am splitting the search term up into each word and then running each word against the database, using a wildcard match in the SQL, i.e.
... WHERE ProductName LIKE %SearchWord1% ...
etc
This does produce some helpful results, but use of the wildcard means anything with the term womens in it would also be shown, i.e. it produces irrelevant results.
I have heard of something called full-text search, and producing indexes, is this something that should be done? I am trying to get some level of intelligent search, but this does not seem like an easy task!
Can anyone give me some general advice?
Thanks
I am looking for some general advice on how to do a meaningful text phrase search on a MySQL database. I have a database full of text descriptions for shopping products, and I want to build a search function against the database that is as useful as possible.
Let's say I have the search term "green mens jumper".
So far, I am splitting the search term up into each word and then running each word against the database, using a wildcard match in the SQL, i.e.
... WHERE ProductName LIKE %SearchWord1% ...
etc
This does produce some helpful results, but use of the wildcard means anything with the term womens in it would also be shown, i.e. it produces irrelevant results.
I have heard of something called full-text search, and producing indexes, is this something that should be done? I am trying to get some level of intelligent search, but this does not seem like an easy task!
Can anyone give me some general advice?
Thanks