PHP/MySQL search recommendation

I’d like to implement a good and simple search on my Web site. Ideally, the search would be able to search pages with .html and .php extensions (pages generated from MySQL database).

Any suggestions?


Ideally, the search would be able to search pages with .html and .php extensions (pages generated from MySQL database).[/quote]

HTML files would be relatively easy as long as you parse out the HTML code and don’t use server-side includes for content - or at least the content for which you’re searching.

As for pages generated from a MySQL database - have you thought that through? You’d have to generate the page again each time you went to search it. That might take a while depending on how many pages you’re talking about and the content pulled from the database for each one. Besides - if what you’re looking for is in the database, shouldn’t you be searching the database itself?

And if you don’t understand what I mean, try figuring out how this discussion forum’s “Search” page works. It doesn’t search pages, it searchs the database…

I have successfully tested here the following script :

I do not yet use it “for real”, but it seems very powerful and easy to customize. The main feature is its ability to index files through http, so it will index php/mysql generated files as if they were seen from the visitor side.

Thank you both for your input. I am quite familiar with how databases work, but not as familiar with how search engines work. I specified in my original post that I wanted the search to index pages generated from the database, rather than database records themselves, because there will be some instances when I might have a record in my site database that I don’t necessarily want indexed and searchable by anyone (i.e., non-public portions of my Web site).

Thanks again. I’ll keep researching and exploring options.

Another option I’m exploring is the search engine a friend of mine built for this site, which works quite well.