views:

68

answers:

5

I want to build a product-search engine.

I was thinking of using google-site-search but that really searches Google's index of your site. I do not want to search that. I want to search a specific table (all the fields, even ones the user never sees) on my data-base for given keywords.

But I want this search to be as robust as possible, I was wondering if there was something already out there I could use? if not whats the best way to go about making it myself?

+1  A: 

As far as stuff that's already out there, take a look at these :

JohnB
+5  A: 

You can try using Sphinx full-text search for MySQL.

Here's also a tutorial from IBM using PHP.

the_void
Sphinx is really fast on both ends (indexing and searching). Definitely worth looking into.
Ariel
Not to mention `Sphinx` would also solve your other issue: http://stackoverflow.com/questions/3088433/sql-plural-singular-searches
the_void
Thanks, I tried to install sphinx, but I guess I am too novice a linux user to know what I am doing, just about every other step gave me some error that I had no clue what it meant or what to do.
John Isaacks
Tutorials: http://acidborg.wordpress.com/2009/11/22/how-to-install-and-configure-sphinx-in-ubuntu-9-10-with-mysql-support/ http://pkarl.com/articles/guide-django-full-text-search-sphinx-and-django-sp/
the_void
Thanks, i'll try my best to figure it out now, if not i'll come back to it once I get a little more linux experience under my belt.
John Isaacks
+2  A: 

I'd focus on MySQL Full-Text search first. Take a look at these links:

Here is a snippet from the first link:

Full-text searching is performed using MATCH() ... AGAINST syntax. MATCH() takes a comma-separated list that names the columns to be searched. AGAINST takes a string to search for, and an optional modifier that indicates what type of search to perform. The search string must be a literal string, not a variable or a column name. There are three types of full-text searches:

Abe Miessler
This will only work for MyISAM tables...
Ariel
Thanks for the info, I'll use this if I can't figure out sphinx.
John Isaacks
A: 

SELECT * FROM table WHERE value REGEXP 'searchterm'

Allows you to use many familiar search tricks such as +, "", etc

This is a native function of MySQL. No need to use go to a new language or plugin which might be faster, but is also extra time for maintenance, troubleshooting, etc.

It may be a little slower than doing some crazy C++ based mashup, but users don't generally notice a difference between milliseconds......

bpeterson76
+1  A: 

One thing you might also want to look into (if you're not going to utilize sphinx), is stemming your keywords. It will make matching keywords a bit easier (as stemming 'cheese' and 'cheesy' would end up producing the same stemmed word) which makes your keyword matching a bit more flexible.

cmendoza