When
you create pages for your site, You should include "meta" tags
within your HTML documents to increase the amount of information
given to the index server for indexing your pages -- these can
be created in Front Page, or inserted manually in your document as follows:
This
way, even if a search parameter (such as the author, or an accurate
description of the content) is not included directly in the text
of the html page, it will be referenced as such in the index.
<
Making
sure Your Site is Indexed
Contact
Superb Technical Support and
ask them to index your site. Once they have confirmed this, you
are ready to try your search page.
In
this section, we will outline a basic HTML form search page.
Sample code can be found below:
for
page under your web root -- /search/index.htm
(it
would be physically in d:\home\username\public_html\search\index.htm)
<---start
sample code--->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Author" content="Your Name here">
<meta name="Description" content="What the page is about">
<meta name="Subject" content="Search page">
<title><This is a Search Page!!></title>
</head>
<body>
<h1>Search our web site</h1>
<!-- the form action tells the page where to put the information -->
<!-- gathered from the html form -->
<form action="query.idq" method="GET">
<!-- The are supplied as hidden parameters, so that you control -->
<!-- the scope and parameters of the search. These are in the form of -->
<!-- variables that are passed on to the query page -->
<input type="hidden" name="CiMaxRecordsPerPage" value="10">
<input type="hidden" name="CiScope" value=/docs>
<input type="hidden" name="TemplateName" value="query">
<input type="hidden" name="CiSort" value="rank[d]">
<input type="hidden" name="HTMLQueryForm" value=/search/index.htm>
<!-- now the actual form where the query is input, and the buttons-->
Enter your query below:
<input type="text" size="55" maxlength="100" name="UserRestriction">
<BR>
<input type="SUBMIT" value="SEARCH">
<input type="RESET" value="CLEAR">
</body>
</html>
<---end
sample code--->
The
hidden fields above aren't required to be hidden if you wish
to allow the user to set sort order, number of items returned,
etc. What they are doing is passing along the values as variables
that will come into play in either the query or the formatting
of the results
CiMaxRecordsPerPage
specifies the maximum number of records displayed per page.
CiScope specifies
the "root" for the search. Here, we're limiting the search
to all directories and documents under the "docs" dir in our
website. Just leave "/" as the value to search your entire
web site.
TemplateName specifies
the name of the file to use to display the results.
CiSort determines
the sort order. rank[d] for descending or rank[a] for ascending.
HTMLQueryForm this
designates the form you are using for your html query -- should
point to this form (this puts it in a variable form that is
passed along)
CiCatalog tells the query
where to locate your catalogue -- if the index has been set up properly,
there will be a catalog.wci directory in your public_html directory.
You DO NOT include the name of the catalog folder in the path leading
to it.
CiColumns determines the
columns of information returned by the query.
CiFlags is set to deep or
shallow -- deep includes subdirectories, shallow only includes that
directory.
CiRestrictions is the User
Restriction from earlier (in the search index.htm -- you will notice
that all the other variables are passed along as well) plus logical
restrictions on the search -- in this case, all of the instances that
were searched for, that also match "*.htm" (ie that are html
documents), and do NOT match having "_vti_" in their path
(ie Front Page extension hidden directories).
Creating an HTML
Template file
Now
that you have made your query, you need to display the results.
You do this by passing the results to an HTML Template File (.htx),
which was specified in your .idq file by the CiTemplate parameter.
In our example, your file would be under your web root at -- /scripts/query.htx
(it
would be physically in d:\home\username\public_html\scripts\query.htx)
This
is in the scripts directory sheerly for instructions sake -- if
you had your permissions set to the tightest (so that the .htm
files were ONLY read, you could put this in a scripts folder where
things had execute permissions, as the htx file actually has to "run").
But you could change the path and have it in your search folder
instead.
The code for this is rather lengthy, so it can be referenced . There
are comments throughout the code, and you can change what it does and
how it works by modifying the code (including graphics, etc -- the default
code has a reference to an MS graphic -- you probably will want to include
another one).