# $Id: modern.cf,v 1.2 2002/07/30 by Harald Weinreich # # Definitions for '{nph-}search.cgi' configuration. # # A hash (#) in the first column denotes a comment and is not processed # even inside a definition. Hashes not in the first column are left as-is. # # Variable substitution occurs on these definitions. If you want # a dollar-sign ($) to occur in the output, escape it with backslash (\). # Other metacharacters (quotes, asterisks, etc) probably don't need to be # escaped. Printf-like special characters are allowed: \n \t \r etc. # # The ending newline is chopped off from each definiton. So # # # abcxyz # # # becomes "abcxyz". You may have blank lines in between the beginning # and ending tags, or use the newline character \n. # # # CGI defaults. # # In this section you can give default values for any attribute that would # normally be passed in from the CGI query form. The following attributes # are currently available: # # brokerqueryconfig : Name of a broker specific configuration file # lifetime : Maximum lifetime of a query (see also section) # caseflag : Whether the query is casesensitive ["on" or "off"] # wordflag : Match on word boundaries ["on" or "off"] # opaqueflag : Show matched lines ["on" or "off"] # descflag : Return object description ["on" or "off"] # noregexflag : Don't do regular expressions ["on" or "off"] # maxresultflag : Maximum number of results to return # maxobjflag : Maximum number of objects to return # maxlineflag : Maximum number of matched lines # weightflag : show weight of hit # csumflag : show link to indexing data # errorflag : Number of spelling errors (therefore it's not really a flag!) # broker : Name of broker # host : Name of broker host # attribute : Space sperated list of attributes to return # sort : Sort options ["by-rank"] # hp_url : Url of search page # These defaults mimic the values on the provided query-glimpse-modern.html form. caseflag : on wordflag : on opaqueflag : on descflag : on noregexflag : off weightflag : off csumflag : off errorflag : 0 maxobjflag : 500 maxlineflag : 30 maxresultflag : 3000 perpageflag : 10 sort : by-rank charset : ISO-8859-1 attribute : headings type file-size #attribute : headings type file-size last-modification-time # 'GLOBAL' VARIABLES: are defined globally within the {nph-}search.cgi program, # but not necessarily set at all times. # # $query the user query string # $html_query the user query string, special HTML characters escaped # $bquery the query string sent to the broker # $host the broker hostname # $port the broker port # $hp_url the URL of the broker query (home) page # $maxresult the maximum number of matched lines the broker will return # $nobjects a running count of the number of objects returned # $nopaquelines a running count of the number of opaque (matched) lines # $filterhint a (HTML)-Text with a verbal description of the current broker filter # # definitions here can be output in other definitions. Each definition # here is placed into the %CFG associative array. For example, # to print out the Timeout defined below, write $CFG{'Timeout'}. # # The URL to the Harvest Project home page. # http://harvest.sourceforge.net/ # The amount of time to wait for the broker results. # Can use aritmetic # here also, eg: 5*60 # # We use a conservative 5 minutes here. # 300 # InitFunction can be some perl code which gets eval'd before they # query is sent. Use this for any special hackings. # $cs_urlX = $csumflag ? 'Y' : undef; # The MIME content type of the query results. Should be "text/html" # if we are going to return HTML tags. # text/html ############################################################################## # RESULT SECTION # # The output of '{nph-}search.cgi' consists of the following tags: # # ResultHeader # CreateNavBars # ResultSetBegin # ( Errors from 'broker' ) # foreach object { # PrintObject # } # ResultSetEnd # EndBrokerResults # ( TruncateWarning ) # ResultTrailer # # ############################################################################## # First output for the HTML containing the results. Should probably include # tag and the user query. # <ResultHeader> <HEAD> <TITLE>Zoekresultaten voor: $html_query

Zoekresultaten voor: $html_query

$filterhint # Final HTML section for the output. Should probably contain a pointer # to the broker home-page ($hp_url) and a pointer to the Harvest # home page. # # Calculations to obtain $navigationBar # Original code by Javier Masa Marin # if ($totalPages > 0) { # elements before and after current page in navigation bar local($navPart) = 5; $prevPage = ""; $prevPage = "\n\n<= Prev ·" if ($page > 1); $nextPage = ""; $nextPage = "· Next =>" if ($page < $totalPages); $pageList = ""; local($startP) = ($page <= $navPart) ? 1 : $page - $navPart; for ($i = $startP; $i < $page; $i++) { $pageList .= "$i\n"; } $pageList .= "$page\n"; local($endP) = ($page + $navPart >= $totalPages) ? $totalPages : $page + $navPart; for ($i = $page+1; $i <= $endP; $i++) { $pageList .= "\n$i\n"; } $navigationBar = "\n$prevPage\n $pageList\n $nextPage" if ($totalPages > 1); } # Output just before beginning the loop over objects returned by the broker. #
\n
$totnumber objecten gevonden $navigationBar Pagina: $page/$totalPages
# # # # # Nieuwe zoekopdracht:
\n # output just after ending the loop over objects returned by the broker #
# # # # # Zoekopdracht: $navigationBar Powered by Harvest
# EndBrokerResults is printed when the broker results end normally. # #\n$msg
\n
# FailBrokerResults is printed when the broker results end in error # \n$msg
\n
# PER-OBJECT DEFINITIONS # ====================== # # VARIABLES: # # $url Object url: http://www.cia.gov:3333/Spies/KGB/secret.html # $A URL Access: http # $H URL Host : www.cia.gov:3333 # $P URL Path : /Spies/KGB/secret.html # $D URL Dir : /Spies/KGB/ # $F URL File : secret.html # $cs_url URL to the SOIF object in the broker databse # $cs_[ahp] elements of $cs_url as above with $url # $desc Description attribute of the matched object # $opaque A matched line (or all matched lines in obj-at-a-time mode) # $usermsg A user message # $attributes Requested attributes # $objectType Type of object if not HTML # $objectSize Size of object # $objectDate Last modification date of object #
$objectnum $description   $objectType   $objectSize  $objectWeight
$attributes
$opaque
Geindexeerde data: geformatteerd · tekst
$url  $objectUpdate

# This definition is eval'd for each opaque (i.e. matched) line retruned by # the broker. It is intended to be used to remove SOIF attributes # and the 'Matched line' string from the output. # The results of these operations are stored in $opaque. # #1. Completely remove lines with @FILE s/^(.*)\@FILE(.*)$/ /; #2. Remove "Matched line #" s/^(.*)\# (.*)$/$2/; #3. Remove "{12}:" etc. s/^(.*)\}:(.*)$/$2/; #4. Remove leading and trailing whitespaces s/^\s+//; s/\s+$//; #5. Limit length to 10 words per matched line. s/^(((\s*)(\S*)){10}).*$/$1/; #6. show 4 matched lines, set maximum length and avoid double matched lines. if ($opaquePerObjectCount>4 || length($_)>120 || $lastOpaqueObject eq $_ ) { $_ = ""; #no output } else { $lastOpaqueObject=$_; $opaquePerObjectCount++; s/(.*)/... $1/; #OK, add dots. } #highlight search words. for ($i=0; $i<=$#searchwords; $i++) { s/(\b$searchwords[$i]\b)/$1<\/font>/ig; } # PerObjectFunction is eval'd before every object is printed out. # # init output variables $objectType=""; $objectSize=""; $objectUpdate=""; $objectWeight = ""; $opaquePerObjectCount = 1; $lastOpaqueObject = ""; # create description $description = "Bestand:  $F"; $description = $desc if (length($desc) > 5); # highlight search words. for ($i=0; $i<=$#searchwords; $i++) { s/(\b$searchwords[$i]\b)/$1<\/b>/ig; } # Create the HTML code to print the weight balls if ($maxWeight > 0 && $weightflag) { $nWeight = int($weight * 5 / $maxWeight); for ($idxWeight = 1; $idxWeight <= $nWeight; $idxWeight++) { $objectWeight .= "\"*\""; } # $objectWeight = "".int($weight * 100 / $maxWeight)."%"; } # format matched lines if ($opaque ne '') { $opaque = "gevonden: $opaque..." } # PerAttributeFunction is eval'd before the Attributes are printed out. # # Remove all empty lines $val =~ s/^(\s*)//mg; # Now prepare the object's type and size to display at the description. if ($att eq "type") { ## show file type $objectType = "[".$val."]" if !($val =~ /HTML|HTTP-Query/); $att=""; # avoid } elsif ($att eq "file-size") { ## calculate file size $val = int($val/1024); $objectSize = $val." KByte" if ($val > 150); # more than 150 KByte $val = int($val/10.24); $objectSize = ($val/100)." MByte" if ($val > 100); # more than one meg $att=""; } elsif ($att eq "last-modification-time") { ## calculate last modification date local(@date,@months,$month,$minute,$year); @date = localtime($val); @months = ('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'); $month = $months[$date[4]]; $minute = $date[1]; $minute = "0$minute" if $minute < 10; $year = $date[5]+1900; $objectUpdate = "$date[3]-$month-$year"; # $date[2]:$minute"; $att=""; } else { ## other attributes # insert commas to separate headings $val =~ s/\n(.)/, $1/mg; # If more than 120 Characters, display only the first 120 plus "..." $val =~ s/^((.|\n){120})(.|\n)*/$1.../; #highlight search words. for ($i=0; $i<=$#searchwords; $i++) { $val =~ s/(\b$searchwords[$i]\b)/$1<\/font>/ig; } } # Format Requested Attributes. Before this is eval'd, $att and $val # should be set. # $att: $val
# ====================================================================== # ERROR, STATUS and WARNING functions # ====================================================================== # The message printed to the browser and logged to the HTTP server log # when the processes is killed. If the Timeout time is reached, the # process dies from SIGALRM. The short name of the offending signal # is placed in $sig. # Killed by SIG$sig...\n # How to format the object number. Use a printf format specification # to left/right justify, or whatever. Do not include quotes around # the format string. # %2d. # A warning message printed only when the broker might have truncated # the result set. Only printed if the number of matched lines equals # the 'maxresultflag' or the number of returned objects equals the # 'maxobjflag' value of the query.html form. #

WAARSCHUWING: De zoekresultaten zijn ingekort bij $nopaquelines gevonden regels en er zijn $nreturned objecten gevonden.

\n # A warning message printed only when the broker returned 0 results. #

Uw zoekopdracht $html_query heeft geen overeenkomstige documenten opgeleverd.

#

Your query either did not match any information in this Broker, or you may have specified a query that is not supported by this Broker's search subsystem.

Suggesties:

  • Controleer de spelling van alle woorden
  • Probeer andere, minder of meer algemene sleutelwoorden
  • Selecteer de "Naar deel van woord zoeken" op de zoekpagina om binnen woorden te zoeken.
  • Sta "spelfouten" toe op de zoekpagina.
Bekijkt U alstublieft de helppagina over het formuleren van zoekopdrachten voor meer informatie.

\n # Error Message returned if there is no query string sent. #

Geen zoekopdracht ingevuld.

Vul a.u.b. een of meerdere sleutelwoorden in.

\n # Message returned if the broker sends back a # 111 - Broker is too heavily loaded # reply. #

Onze excuses, de zoekmachine op $host, poort $port is op het moment te druk om uw zoekopdracht te verwerken.

Probeert u het later nog eens.

# Error message if broker is not available. #

Zoekmachine tijdelijk niet beschikbaar

Onze excuses, de zoekmachine op $host, poort $port is niet beschikbaar.

Probeert u het later nog eens.

\n # Message returned if the broker sends back a # 111 - PARSE ERROR # reply. #

Uw zoekopdracht $html_query bevat geen geldige syntax.

Bekijkt U alstublieft de helppagina over het formuleren van zoekopdrachten voor meer informatie over goede syntax.

Veel gemaakte fouten in de syntax zijn onder andere:

  • Het niet gebruiken van aanhalingstekens bij zinnen of reguliere expressies..
    Bijvoorbeeld, de zin: resource discovery zou "resource discovery" moeten zijn. De reguliere expressie: res.* disc.* zou "res.* disc.*" moeten zijn. Een enkele punt (``.'') in een sleutelwoord moet ook omgeven zijn in aanhalingstekens. (b.v. "3.0").
  • Missende punctuatie.
    Gestructureerde zoekopdrachten vereisen een dubbelen punt en optioneel haakjes. Bijvoorbeeld, Type:PostScript of, (Type : PostScript)
\n