#!/usr/local/bin/perl # ice-form.pl -- cgi compliant ICE search interface # # ICE Version 1.5 beta 3 rev2 # March 2000 # (C) Christian Neuss / fax (425) 732-7343 #--- start of configuration --- put your changes here --- # Title or name of your server: # Example: local($title)="Search this server"; local($title)="Wild Boar Search Engine"; # search directories to present in the search dialogue # Example: # local(@directories)=( # "DZSIM (/www/projects/dzsim)", # "CSCW Laboratory (/www/projects/cscw-lab)", # ); # local(@directories)=( # "Next (/NextLibrary)", # "WISE (/www/projects/wise)", # "Multimedia Survey (/www/projects/mms)", # "DZSIM (/www/projects/dzsim)", # "CSCW Laboratory (/www/projects/cscw-lab)", # "WWW-Schulung (/www/igd-a3/schulung)", # ); # Location of the indexfile: # Note: under Windows or Windows NT, add the drive letter # Example: $indexfile='/usr/local/etc/httpd/index/index.idx'; $indexfile='/www/htdocs/domains/domain3/00095/www.wildboar.net/webdocs/cgi/ice/ice1-5/index.idx'; # Location of the thesaurus data file: # Example: $thesfile='/igd/a3/home1/neuss/Perl/thes.dat'; # $thesfile='/igd/a3/home1/neuss/Perl/thes.dat'; $thesfile='/www/htdocs/domains/domain3/00095/www.wildboar.net/webdocs/cgi/ice/thes.dat'; # Document Root and Aliases for your server. The Document Root is # the directory where the "top level" documents reside. Additional # mappings can be set via the "Aliases" variable (which can be left # empty if no additional mappings exist). # # Important hint: if you are unsure about how to set $docroot, # look at the end of the index file. $docroot must be set so # that it matches the paths found there. # # Example # $docroot = '/usr3/webstuff/documents'; # %aliases = ( # '/projects', '/usr/stud/proj', # '/people', '/usr3/webstuff/staff', # ); # $docroot = '/www/htdocs/domains/domain3/00095/www.wildboar.net/webdocs'; %aliases = ( ); # The following configuration settings are OPTIONAL # # you can localize the BODY tag, if you want. Use an absolute # path such as the one given in the example if linking to a # background image. # Example: # $BODY = '
'; # Maximum number of hits to return # Example: # $MAXHITS=100; $MAXHITS=50; # Minimum length of word to be indexed (same as in ice-idx.pl) # Example: # $MINLEN=3; $MINLEN=3; #--- end of configuration --- you don't have to change anything below --- local(@errStack); # do the real work, but trap any errors eval '&main'; # if an error has occured, log it to stdout if($@){ &send_header("Error in Script"); # just in case print "$@\n "; } # main loop sub main { # if this script is called up "by hand", run a test unless($ENV{"SCRIPT_NAME"}){ if($ARGV[0] eq "-i"){ print &buildIndex(); } local($word) = ($#ARGV==-1) ? "test" : join(" ",@ARGV) ; print &performQuery($word); return; } # if content_length is zero and query string is empty if (($ENV{CONTENT_LENGTH}==0) && (length($ENV{"QUERY_STRING"})==0)){ # we're not decoding a form yet => send the form &send_header("$title"); &send_index(); &send_trailer(); return; } # else: request from the web %forms=&cgiparse(); if($forms{"BUILDINDEX"}){ &send_header("Site Index"); print &buildIndex(); &send_trailer(); return; } &send_header("Query Result"); print &performQuery($forms{KEYWORDS}); print "More than $MAXHITS hits. Use a more restrictive search
"; } } return "no matches found." unless ($text); return "