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!

Error: Please check your email address.
Rocket to Success - Your 10 Tips for Smarter ERP System Selection
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

Breitling Superocean Heritage Chronographe 44

Learn more >

SanDisk MicroSDXC™ for Nintendo® Switch™

Learn more >

Toys for Boys

Family Friendly

Panasonic 4K UHD Blu-Ray Player and Full HD Recorder with Netflix - UBT1GL-K

Learn more >

Stocking Stuffer

Razer DeathAdder Expert Ergonomic Gaming Mouse

Learn more >

Christmas Gift Guide

Click for more ›

Most Popular Reviews

Latest Articles


PCW Evaluation Team

Edwina Hargreaves

WD My Cloud Home

I would recommend this device for families and small businesses who want one safe place to store all their important digital content and a way to easily share it with friends, family, business partners, or customers.

Walid Mikhael

Brother QL-820NWB Professional Label Printer

It’s easy to set up, it’s compact and quiet when printing and to top if off, the print quality is excellent. This is hands down the best printer I’ve used for printing labels.

Ben Ramsden

Sharp PN-40TC1 Huddle Board

Brainstorming, innovation, problem solving, and negotiation have all become much more productive and valuable if people can easily collaborate in real time with minimal friction.

Sarah Ieroianni

Brother QL-820NWB Professional Label Printer

The print quality also does not disappoint, it’s clear, bold, doesn’t smudge and the text is perfectly sized.

Ratchada Dunn

Sharp PN-40TC1 Huddle Board

The Huddle Board’s built in program; Sharp Touch Viewing software allows us to easily manipulate and edit our documents (jpegs and PDFs) all at the same time on the dashboard.

George Khoury

Sharp PN-40TC1 Huddle Board

The biggest perks for me would be that it comes with easy to use and comprehensive programs that make the collaboration process a whole lot more intuitive and organic

Featured Content

Product Launch Showcase

Latest Jobs

Don’t have an account? Sign up here

Don't have an account? Sign up now

Forgot password?