Search! as in website

SDMB, Snopes, CNN, thousands of other websites have search functions on them. As i understand it, those sites also run databases and talk with Java or ASP or CF. Is it possible to have a search box that can still search the documents and their content without having a database that holds all the articles and queries them at the click of the mouse?

If it makes any difference i use Dreamweaver and i haven’t been able to figure it out the way the Dreamweaver Bible talks about it.

You can’t have a search engine without some kind of index. The index doesn’t need to be a relational database; it can be something simpler like a big BerkeleyDB file. But at the very least you need something on the server that knows which documents contain which words. Otherwise, you would have to open and search through every document for every request. That would suck.

A nice way to cheat is to just hack up a google search and put that on your site. Here’s how.

I don’t see why not. Database indexes are usually faster, but if you really wanted to, a script could use regular text files to store all the information it needs.

Even simpler than that, a script could make the computer manually search through all the files on the hard drive every single time a search is performed – but this would be hideously slow, of course. It’s like the difference between using the standard Windows search, which doesn’t index anything by default, and Google Desktop Search, which has a index listing which words exist in which files.

This isn’t really a question about Dreamweaver. Dreamweaver is just an editor and what you need is an actual script that can perform searches without an underlying database. For ready-made scripts, I’d check out the PHP Resource Index if your webhost supports PHP, or the CGI Resource Index if it only supports Perl/CGI.

Oops – the example you probably want to look at is the third one on that page.

Quite a few sites (TalkOrigins comes to mind) just put together a redirect to Google (or other search engine) with a search string that’s limited to the site in question.

It would of course be possible to write some code that lives on the server to search through the articles “manually”, but you’d basically be writing your own database server - a bit of a waste of effort if you have MySQL already there to do the work for you.

The site i have supports neither Perl nor PHP. I’m inheriting this site from the web admin that resigned a month ago. I kinda sorta know what i’m doing with the design and links and some other little things, but nothing as complex as scripting or database indexing.

friedo thanks for the link, but i won’t be able to use it since this an intranet site and 85% is not accessible from the internet. The other caveat is that many of the computers on the network are restricted from internet access so the Google search won’t be able to do much help in either case.

The CGI Resource Index has scripts in a few other languages, like C++… does your server support any of those?

In lieu of an actual search function, a good site map could also do wonders as long as your site isn’t TOO big.

To be honest, then, I wouldn’t recommend doing this on your own, if it’s for work and you don’t have any experience with programming.

Tell your boss that, if they want a search function, they’re going to have to get in a contractor. I assume that programming isn’t part of your job description.

If you are forced to do it - do you have a database of any sort on your server? Probably MySQL if you do. It’s going to be a lot easier for you to learn that than it is for you to write the code yourself from scratch. If any part of your system is publically accessible, it’s vital that you incorporate some sort of security to your code; there are lots of tricks that hackers can use to cause serious damage in an unsecured MySQL environment. (And, yes, this is intended to put you off doing it. I wouldn’t want you to lose your job because some code insecurity that was due to your inexperience caused damage to your server. I doubt if your boss would appreciate that happening, either.)

There is one part of the site that has a guestbook/recommendation book that uses PHP5.0.5 which is installed. Does this help my situation at all or give me an option to fiddle with a script to make an index?

Yes! That means you can use the scripts at the PHP Resource Index. Find one that doesn’t require a database and set it loose.

However, I think Tevildo has a good point. If this isn’t part of your job requirements, you may want to think twice before agreeing to implement it.

I’m not sure, but I think this could lead to a situation where things are not found, even though they ARE on your website. Google searches an index it builds by examining websites, but this only happens periodically. There is likely to be a delay, especially if yours is a small volume, limited site. So you could post new material at your website, but it might be weeks before that gets into Googles index and can be found by that search on your website.

Anybody have any more info on this?

You’re right, but the point is moot, since the OP’s site is a private intranet.

The other option is ultra-manual search. Just duplicate all the content on one big page and let people’s browsers do the searching for them.

This would be a page linking over 4.5 GB large and over 16,000 html and pdf and mht files!

Okay, for something that big, you NEED a database. Theres no real way of getting around it.

Let’s say i decide to put them into a database, could i use MSSQL? I know some of the administration pieces of MSSQL2k, but not so much how to build a database from scratch. Generally, how does one go about putting a document into a table? I’m used to names and numbers going into tables that hold patient information which is doesn’t make for very large tables, just thousands of them. But i don’t know how to actually make a table for, let’s say for example “Nursing,” and have a hyperlink open up the .pdf called “ICU Guidelines for Patient Discharge”

You don’t have to manually create the database entries. Most of the search scripts on the PHP Resource Index automatically deal with the database backends and create/populate all the tables you need. The first script in the list happens to work with MSSQL too!

These scripts are all-in-one solutions… you provide them with a database to use and webpages to index and they’ll do the rest.

You don’t have to manually create the database entries. Most of the search scripts on the PHP Resource Index automatically deal with the database backends and create/populate all the tables you need. The first script in the list happens to work with MSSQL too!

These scripts are straightforward, end-to-end solutions… you provide them with a database to use and webpages to index and they’ll do the rest.

Oops, sorry for the double post. (Mods, please feel free to delete the first post and this one as well)

There’s plenty of third party solutions that handle this stuff for you. Fusionbot is one good one.