Opus One


Internet Services

Tech Support

How to use the gsearch scripts with your site index

The "GSEARCH-AND" and "GSEARCH-OR" scripts are used to search full-text indices which you have previously created. If you don't know how to create a full text index, look here for more information. There are a zillion options you can use when creating your full-text index, including the possibility of changing titles, captions, etc. It's all in there. To see more on that, look at lib_source:[vmsindex]build_index.doc.

gsearch-and and gsearch-or are very similar. Basically, they run searches on pre-made indices that look like this:

mainsearch AND (addtlterm1 AND addtlterm2 AND addtlterm3)

or

mainsearch AND (addtlterm1 OR addtlterm2 OR addtlterm3)

The first of these is created by gsearch-and; the second is gsearch-or. In this document, we use "gsearch" as the generic for either script, since they are identical except for the use of the AND/OR terms.

You drive the gsearch scripts by "hiding" terms in your form. This is a standard and common technique. The most basic call to gsearch has to have at least two terms:

  • query - the "main search"
  • index - the disk, directory, and file name of the index to search

Most searches will have at least one other term:

  • addsearch0 - one additional search term (you can have up to 10 additional search terms, numbered from 0 to 9, thus: addsearch0, addsearch1, addsearch2)

From here, you can have about a dozen other OPTIONAL search terms. These include:

show_filetype Specify this as "YES" if you want pointers to special file type icons & relevant ALT tags. Seldom used. Default = NO.
maximum_hits Specify a number here if 250 hits is either too many or too few hits to return.
show_size By default, the size of the file will be shown after the file description. Specify "NO" here if you want this to be suppressed. Default = YES.
show_date specify this as "YES" if you want the last modification or creation date of the file to be shown after the file description. Default = NO.
show_time Specify this as "YES" if you want the last modification or create time to be shown after the file description. Typically used in addition to show_date. Default = NO.
use_mdate Specify this as "YES" if the time/date specified in show_date and show_time should be the MODIFICATION date. By default, the time/date will be CREATION date/time.
sort Specify this as "YES" if you want the results to be sorted by the "relevance" score to your keywords. Default = NO.
show_score Specify this as "YES" if you want the relevance score to be shown after the file description. Default = NO.
title Specify a string here which will be the <TITLE> of the page which comes out. default = "Results of index search".
minimum_word Specify a number here which is the minimum keyword length to use. Default = 3.
send_contents Specify this as "YES" if you want the user to be simply redirected to the index hit if there is only one hit. Default = NO.
header Specify a URL minus the scheme and host (e.g., /www/foobar/header.html) which will be written to the end user IN PLACE OF the normal header. You MUST include ALL prefix information (including <html> and <head> stuff).
footer Like header, but for use AFTER the results of the query are written out.

You can also "pretty up" your URLs. This is really a cosmetic thing, but may help your URLs to be more "generic." Basically, the index stores your real disk name & directory in the index. This means that when a query comes out, you get a URL like this:

http://www.foobar.com/disk$ebony/foobar/www/realdir/realfile.html

What you probably wanted was:

http://www.foobar.com/realdir/realfile.html

You can effect this by defining these two symbols in your form:

  • ipath_translated - the real directory name you want to rip out. A typical value would be "/disk$ebony/foobar/www/".
  • ipath_info - the replacement for that string. A typical value would be "/" (slash).

Here is an example of a simple search:

<form method="post" action="http://www.ibs-net.com/htbin/gsearch-or"> 
<input name="index" type="hidden" value="disk$ebony:[ibs.www]ibsfulltext">   
<input type="hidden" name="addsearch0" value="keyart">
<input type="hidden" name="show_score" value="yes">
<input type="hidden" name="sort" value="yes">
<input type="text" size=20 maxlength=100 name="Query" value=""> 
<input type="image" align=absmiddle alt="Search" border=0 src="img/search.gif"><p>
</form> 

Fax me this page Search the site


Home . Consulting . Library . Internet Services . About Us

© 1998 Opus One . Site by DesertNet Designs


1404 East Lind Road, Tucson, AZ 85719 . Phone: 520-324-0494 . Fax: 520-324-0495