A question from Yahoo! Answers:
Php search engine script?
l am looking for a free PHP search engine script for a web site. l would like one that is not too complicated. Does anyone know where to go for such a script?
There are two ways to attack this problem. One is to use an API to an existing search engine such as Yahoo! or Google:
Basically, you script would collect the search terms submitted by the user, add an instruction to limit the search to your site, pass it on to the target search engine, retrieve results and display them.
Yahoo! API is probably a little easier to implement in PHP, since you can choose to receive search results as serialized PHP data (other options are XML and JSON). Google API only has one option, XML.
The alternative is more complicated. You need to deploy a full-blown search engine of your own, complete with a crawler and a database for storing results. Here are a couple of examples of those:
Update (Aug. 3, 2007): there is also a pretty decent PHP search engine called Sphider, written in Estonia by Ando Saabas…