views:

263

answers:

5
+2  Q: 

Full site search?

I was hoping someone could give me some advice, I am hoping to implement a full site search on a website that I building with codeIgnitor, PHP and mySQL. I was hoping someone would be able to over me some advice on wheather there are any free API's that enable a full site search, or any tips on building my own, how would be the best way to build a search function that all the content for the keyword searched for?

I hope someone can help thanks

+2  A: 

Check out Lucene for PHP, it could come in handy.

mauro.dec
A: 

http://www.htdig.org/ is a C++ based search engine you can determine which data it works on

Stijn Sanders
+1  A: 

You could use Google Custom Search and let Google do all the hard work. I hear they're quite good for searching websites.

If you want something a little fancier you can pay for Google Site Search.

Dave Webb
+2  A: 

Or you could try using Sphinx ( http://sphinxsearch.com/ ) - fast, lightweight, though it needs to run as a daemon on the box, so it's not suitable for shared hosting.

bisko
Seconded. Sphinx is an excellent search engine, it is really easy to configure with MySQL (you just write a SQL query to tell it what to index) and it comes with a PHP API.
casey
A: 

I have to agree with all of the above. Sphinx and Lucene are the way to go. But if your site is small and you want to try a really really simple solution why don't you explore MySQL Fulltext search?

That said the field, fields to search must be a Fulltext index. So you can grab a pair of text fields and some varchar fields and jointhem all in a Fulltex Index.

SELECT * FROM articles
WHERE MATCH (title,body)
AGAINST ('database' WITH QUERY EXPANSION);

But go and have a better look at MySQL manual!

Frankie