site product search

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

site product search

Post by Burrito »

Hi, I am building a new site that is going to have a lot of different types of products and I need to add a search feature from the home page that would allow the user to find relevant items.

I see this everywhere and some of the more advanced ones return results with a percentage of how relevant the results were.

IE, if I did a search for 25" widgets I might get some results like

25" Widgets - 100%
Black Widgets - 80%
etc.

I assume that I need to use full text indexing on my fields in my DB but other than that I have no clue where to go.

if anyone can shed some light I'd really appreciate it.

thx for your time,

Burr
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

Are you asking how to build the search feature, or how to do the percentage thing? The search feature could just be a simple SQL query, and I would imagine the percentage thing is how many of your search string words showed up in the result entry.

(P.S. If you WERE the Alpha and the Omega, you wouldn't need to ask this question now would you? :wink:)
McGruff
DevNet Master
Posts: 2893
Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland

Post by McGruff »

If you are using mysql, see [mysql_man]Full-text Search[/mysql_man] for info on obtaining relevance.
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

thx

Post by Burrito »

Thanks crimedog, I'll check into it.
Steveo31
Forum Contributor
Posts: 416
Joined: Sun Nov 23, 2003 9:05 pm
Location: San Jose CA

Post by Steveo31 »

McGruff wrote:If you are using mysql, see [mysql_man]Full-text Search[/mysql_man] for info on obtaining relevance.
Interesting... the bbCode didn't work...

http://www.mysql.com/doc/en/Fulltext_Search.html
Post Reply