Start your engines

Designing your own search engine for a site has, until recently, been fiendishly difficult, involving no small amount of skill in scripting languages or creating databases. To be honest, a fully-customised, searchable database still requires considerable ability, and I'll probably look at your options for creating such a search engine in MySQL some time in the near future.

In the meantime, the Web provides a number of alternatives in the form of ready-made scripts or third-party resources that are easier to adapt.

Perl and simple searches

If you have access to the cgi-bin on your Web site, one tried-and-trusted way to set up a search engine is using a Perl script which is very competent at ploughing through Web pages looking for text.

There are plenty of Perl-based Web searches available online, the most widely used being Simple Search ( Here, because it is slightly easier to set up (and it's got a great name), we'll be using Jason Anthony's Jasearch ( - see screen shot.

Jasearch has two components, the HTML search form and a script engine, This script is particularly easy to set up because it will probably require no modification at all - so long as your first line points to the appropriate location of Perl (for example, #!/usr/bin/perl) as all variables are set up in your Web page.

After you've loaded to an appropriate cgi-bin directory on your server, you create a Web form that includes the following code:

&lt form method="post" action="cgi-bin\" &gt &lt input type="hidden" name="base" value="../yourdirectory" &gt &lt input type="hidden" name="rbase" value="" &gt Search for &lt input type="text" name="sv" value="" &gt &lt input type="submit" value="Search" &gt &lt input type="reset" value="Reset" &gt &lt /form &gt

Back to base

You will be able to add these buttons and fields in pretty much any Web editor, but the values for the various hidden and text fields (base, rbase and sv) are important.

Base indicates the directory you want to search on your server, while rbase provides the URL. The name sv for the text search box is the standard variable used within itself - while it is possible to change this, you will then need to modify the perl script. With the code in place as listed above, any words entered into your text field sv will be posted to the Jasearch Perl script and results returned to a pre-created search results page.

Within the script, you'll find the parameters to modify the format of this page. Of course, you should adapt your initial search form to match the look and feel of your site.

JavaScript searches

Perl was designed to work with text documents and has the advantage of being supported across many Web sites, but if you don't have access to a cgi-bin folder it can be impossible to implement.

Instead, you could use Java­Script code to provide text searches that do not need access to Perl, executable files or any other scripting languages on the server. The downside, of course, is that any visitor who turns off scripting will not be able to access your search engine. JavaScript searches work either by trawling a basic text file/database that you load on to your site with your Web pages, or by linking to an engine that's run by a third party. I've thrown together a few details about the latter (see "Add hassle-free searches with FreeFind"), but another, more recent launch is AddSearch, which provides a free plug-in for your site - see here.

The X factor

Of the flat-file database searches, one good source is XSearch 5.2: this was developed by Dynamic Core, although it doesn't appear to offer support for it any longer, and the original Web site has been closed ( A search in Google will turn up plenty of sites where you can download the code - including the all-important db.js files - and an editor is also available at to help take some of the tedium out of creating your database. Of course, you could just head to the cover disc instead.

Alternatively, at you'll find the JavaScript code for search­ing through a number of URLs or metatags on your site. As the author suggests, the JavaScript Editor is an easier way to generate such code and you can download a 30-day trial from the same site.

If you want a world-class search engine, it's also worth bearing in mind that Google has started making available its API (application programming interface). The service is still in beta and restricted to 1000 searches a day - and you'll need some skills to integrate it into your site via XML - but it offers enormous potential. For more information, go to

Sites OF THE MONTH While not dedicated to search engines per se, you will find customisable scripts for these as well as nearly 6000 others at ScriptSearch ( Quantity itself is no guarantee of quality, but there are some great Web widgets available here, whether you need a free subscription manager, shopping cart scripts or remotely hosted bulletin boards. Scripts are available in a wide range of languages, including ASP, Flash and Python as well as Perl and PHP.

Add hassle-free searches with FreeFind

If you want to create a search engine with the minimum of programming - and cost - another alternative is to use a remotely hosted engine such as that provided by FreeFind (details at Once you've registered the details of your site and a username/current e-mail, log on to the control centre at to use FreeFind to generate a search engine for your site.

This process consists of two parts: first of all, you need to generate an index of your site by clicking on the Build Index tab. You can schedule this to take place at a certain time, or click the Index now link - it may take up to 24 hours to complete. You can also specify advanced options such as whether to index PDFs or exclude certain areas.

After your site has been indexed, click on the HTML tab to create the code you need to access the search engine. Simply copy and paste the HTML provided to create a simple search box and button that you can then customise in your favourite Web editor.

Join the newsletter!


Sign up to gain exclusive access to email subscriptions, event invitations, competitions, giveaways, and much more.

Membership is free, and your security and privacy remain protected. View our privacy policy before signing up.

Error: Please check your email address.
Keep up with the latest tech news, reviews and previews by subscribing to the Good Gear Guide newsletter.

Jason Whittaker

PC World
Show Comments

Cool Tech

Toys for Boys

Family Friendly

Stocking Stuffer

SmartLens - Clip on Phone Camera Lens Set of 3

Learn more >

Christmas Gift Guide

Click for more ›

Brand Post

Most Popular Reviews

Latest Articles


PCW Evaluation Team

Aysha Strobbe

Microsoft Office 365/HP Spectre x360

Microsoft Office continues to make a student’s life that little bit easier by offering reliable, easy to use, time-saving functionality, while continuing to develop new features that further enhance what is already a formidable collection of applications

Michael Hargreaves

Microsoft Office 365/Dell XPS 15 2-in-1

I’d recommend a Dell XPS 15 2-in-1 and the new Windows 10 to anyone who needs to get serious work done (before you kick back on your couch with your favourite Netflix show.)

Maryellen Rose George

Brother PT-P750W

It’s useful for office tasks as well as pragmatic labelling of equipment and storage – just don’t get too excited and label everything in sight!

Cathy Giles

Brother MFC-L8900CDW

The Brother MFC-L8900CDW is an absolute stand out. I struggle to fault it.

Luke Hill


I need power and lots of it. As a Front End Web developer anything less just won’t cut it which is why the MSI GT75 is an outstanding laptop for me. It’s a sleek and futuristic looking, high quality, beast that has a touch of sci-fi flare about it.

Emily Tyson

MSI GE63 Raider

If you’re looking to invest in your next work horse laptop for work or home use, you can’t go wrong with the MSI GE63.

Featured Content

Product Launch Showcase

Don’t have an account? Sign up here

Don't have an account? Sign up now

Forgot password?