Customizing the Search

You may make common changes to Webinator's search appearance by using Search Settings from the administrative interface main menu. But you are not limited to those features. You may change any and all aspects of the search program's appearance and behavior by modifying the supplied search script or writing an altogether new one.

For details on programming with Texis Web Script (Vortex), see the manual at the Thunderstone web site, https://docs.thunderstone.com/site/vortexman/.

The following section describes some important points about the internals of the default search script that comes with Webinator. The search script is fairly heavily commented to aid in finding your way around within it.

The init function is called from every entry point. It is a good place to put settings that should always (or often) apply. This function understands the old (version 2) style specification of database by the db variable as well as the current method of extracting the database name from the profile named by the pr variable.

The top function displays the common HTML for the beginning of every page generated by the search script. This does not include the search form. This function is where you would place styles and navigation menus.

The bottom function is the complement to the top function. It displays the common HTML footer for the end of every page.

The showform function displays the search form with all current settings indicated.

The qpar and fpar functions process the user's form submission and apply appropriate search settings.

The credit function displays the Thunderstone credit on the search results. This is required for free users but may be changed or emptied for paid users.

The result function is called for each matching record to display. It then calls the configured result* function to generate the desired output style.

The mlt function is called to setup the search when the end user selects "Find Similar" (aka More Like This).

The similar function may be called directly to find pages within the database that are similar to the content of the URL specified. It has the same concept of "Find Similar" but will work on any specified URL, not just those displayed as the result of a search. It would be invoked something like this on any HTML page.

<a href="/cgi-bin/texis/webinator/search/similar.html?pr=default&ref=http://example.com/somepage.html">Find pages similar to somepage.html</a>

or

<a href="/scripts/texis.exe/webinator/search/similar.html?pr=default&ref=http://example.com/somepage.html">Find pages similar to somepage.html</a>

Set default above to the search profile you're using.

It will lookup that URL in the database or, if it's not in the database, fetch it from the webserver. It will then search the database looking for indexed pages similar to the specified page.

The main function is the standard Vortex default entry point. This is the function that is first called when users click "Submit" on the search form.

The search function does the core work of finding matching documents within the database. It calls showform and qpar then starts searching. For every match the result function is called. The summary function is called before the first match is displayed to display the search results summary. It is called again at the end of the results list.

The putmsg function handles errors that may occur and displays them in a somewhat more user friendly fashion. See the Vortex manual for details about how putmsg is used to capture errors.


Copyright © Thunderstone Software     Last updated: Apr 15 2024
Copyright © 2024 Thunderstone Software LLC. All rights reserved.