Funnelback logo

Documentation

Search.cgi

Introduction

search.cgi is the CGI script that Funnelback uses as its Classic UI search interface. The Modern UI equivalent is called search.html.

It has the responsibility to:

  • display search forms
  • validate and execute queries
  • format and display search results

Changing the look, feel and general presentation of search results can be achieved through modifying the search form files, and by modifying the parameters that search.cgi receives (usually from HTML forms).

Processing steps

A simplified set of steps performed by search.cgi is:

  • For non-query requests:
    1. HTTP request for search.cgi?collection=shakespeare
    2. Read search form
    3. Process <s:InitialFormOnly> tag contents
    4. Return HTML
  • For query requests:
    1. HTTP request for search.cgi?collection=shakespeare&query=juliet
    2. Run query and obtain XML results
    3. Read search form
    4. Process <s:AfterSearchOnly> tag contents
    5. Return HTML

Advanced CGI Parameters

search.cgi has its behaviour and the results it presents controlled by the parameters that are given to it by means of the requested URI. Many of these parameters are really query processor options, and hence are documented in the section on Query Processor Options. The other parameters specific to search.cgi that are available and their meanings are listed here:

Option Values Explanation
collection collection ID This is the most important parameter as it selects the collection to be searched over. Many aspects of Funnelback's behaviour will be controlled by the collection-specific configuration files. E.g selecting collection=myIntranet will search across the myIntranet collection.
form simple, advanced, other The name of the form file to use as the basis for the search interface. E.g. selecting form=simple will use the simple.form as an interface.
query valid query The query terms to be processed. See the page on simple searches for details on what makes a valid query.
cleanhtml 1 This option instructs search.cgi to remove comments and whitespace from the returned HTML. It has the same effect as setting the enable_clean_html collection configuration parameter
clive collection ID This option specifies which components of a meta collection to search at query time. Use separate parameters for multiple collections e.g. clive=collection_one&clive=collection_two
enc character encoding This parameter specifies what character set has been used to encode the query parameter. This must be set if UTF-8 encoding is not used. E.g. enc=ISO-8859-1
gscope1 comma separated list of gscope numbers This option is similar to the 'gscope1' option specified in the Query Processor Options but if specified here, it can simply be a list of gscope numbers that will be treated as being or'ed together, rather than requiring a full reverse Polish expression.
meta_X valid query term Adds a metadata search field to the query to be processed. E.g. selecting meta_X=term adds the term X:term to the query, where 'X' is a valid metadata class (a-z, A-Z, 0-9). This is mainly used in advanced search forms where the query must be made up from different HTML form entries.
meta_X (d, d1, d2, w1, w2, x, y, z) valid query term Date-based metadata search fields.
meta_X_year, meta_X_month, meta_X_day valid query term Date-based metadata search fields.
oneshot 1 Directs the browser to the first result rather than displaying a page of results.
profile profile name This option is identical to the 'profile' option specified in the Query Processor Options.
query_and valid query term Adds an and term to the query to be processed. E.g. selecting query_and=term adds the term +term to the query. This is mainly used in advanced search forms where the query must be made up from different HTML form entries.
query_sand valid query term Adds a compulsory and term to the query to be processed. E.g. selecting query_sand=term adds the term ''|term'' to the query. This is mainly used in advanced search forms where the query must be made up from different HTML form entries.
query_trunc valid query term Adds a truncated term to the query to be processed. E.g. selecting query_trunc=term adds the term *term* to the query. This is mainly used in advanced search forms where the query must be made up from different HTML form entries.
query_phrase valid query term Adds a phrased term to the query to be processed. E.g. selecting query_phrase=term%20word adds the term "term word" to the query. This is mainly used in advanced search forms where the query must be made up from different HTML form entries.
query_prox valid query term Adds a proximity set of terms to the query to be processed. E.g. selecting query_prox=term%20word adds the term `term word` to the query. This is mainly used in advanced search forms where the query must be made up from different HTML form entries.
query_or valid query term Adds an or'ed set of terms to the query to be processed. E.g. selecting query_or=term%20word adds the term [term word] to the query. This is mainly used in advanced search forms where the query must be made up from different HTML form entries.
query_orplus valid query term Adds an or'ed set of terms to the query to be processed. E.g. selecting query_orplus=term%20word adds the term +[term word] to the query. This is mainly used in advanced search forms where the query must be made up from different HTML form entries.
query_orsand valid query term Adds a compulsory or'ed term to the query to be processed. E.g. selecting query_orsand=term%20word adds the term ''|[term word]'' to the query. This is mainly used in advanced search forms where the query must be made up from different HTML form entries.
query_not valid query term Adds a not term to the query to be processed. E.g. selecting query_not=term adds the term -term to the query. This is mainly used in advanced search forms where the query must be made up from different HTML form entries.
scope scope string Similar to the 'scope' option specified in Query Processor Options but if specified here, multiple 'scope' parameters will be conflated into one parameter.
showform true/false This parameter forces the search form to be displayed without running a query or showing any query results, even if a query parameter is defined. The same effect can be achieved by ensuring that no query parameter is set.
tiers on/off Shows or hides the 'tier bars' that indicate the logical breaks in between results that satisfy more of the search criteria than others.
bb_tiers on/off Shows or hides the 'tier bars' for best bets that indicate the fact that the results are best bets rather than search result pages.
xml 1 Forces the results to be displayed in XML format, rather than using HTML and the specified forms. (Note this is a substitute for the res=xml option specified in Query Processor Options, as for technical reasons the res= option cannot be used from search.cgi.)
morph, morph_target various Morph query parameters enable the user to choose the type of operation that is applied to the query via a select list. See Morph query parameters for details.

The Query Processor Options page lists CGI parameters specific to the query processing system, including sorting, stemming and many more.

See also

top ⇑