How to Put a Site Search Engine On Your Website
There are three ways
to add a site search to your website.
1. Installing Your Own Search Engine
Script
The ideal way, in my opinion, is to install your own Perl search
engine script or (if you prefer) PHP search engine script. This requires you to
have CGI access (or PHP as the case may be) on your web account.You can get one
of the numerous free search engine scripts and adapt it to your site. You can
find a list of some free
search engine Perl CGI scripts
z
2. Using a Free or Commercial
Third Party Search Engine Service
If installing a PHP or Perl CGI script
is a problem, then you can use one of the many free or commercial search engine
services. These services index your site for you and provide you with the HTML
code to plug into your web pages. That's it. You have a working search engine
for your site with little of the installation woes.
A list of Free
Search Engine Remote Hosting Services
3. Using the Major Search
Engines
You can actually use the major search engines like Google and
Alta Vista as your site's search engine, free of charge.
To do this with
Google, go to http://services.google.com/cobrand/free_select
and complete the online form.
If you prefer to use Alta Vista, you will
need to create a form modelled on the following code:
<form method="get"
action="http://www.altavista.com/cgi-bin/query"> <input type="hidden" name="pg"
value="q" /> <input type="hidden" name="text" value="yes" /> <input
type="hidden" name="what" value="web" /> <input type="hidden" name="fmt"
value="" /> <input type="text" name="q" value="%2Burl%3Awww.example.com
" /> <input type="submit" value="Search" /> </form>
Change
"www.example.com" to your own domain name. To search your site with that form,
you simply type your query after the "+url:www.example.com " (where "www.example.com"
is replaced by your real domain) text that appears in the the search entry box,
and hit the "Search" button. This will cause the query to be sent to Alta Vista's
engine. If you put a "target" attribute in the form tag, you can even direct the
results so that it appears in a frame with your site URL still showing.
This method has the following additional disadvantages:
- The re-indexing frequency of your site is even more limited than when using
one of the CGI hosted services mentioned above. You have basically no control
over the frequency that the major search engines index your site. This means that
the search engines results will frequently be inaccurate - and if you add new
pages to your site often, your site search engine will not be able to locate it.
- The
results page has the search engine's advertisements and formatting. You have even
less control over the output than when using the third party search engine remotely
hosted services.