Swish-e is a free search engine is used to search the contents a set of web pages. Although it might not be the best engine available, we have been using in HOOPS 3DF for a number of years and have all the infrastructure in place to run it on our web server. The other alternative is Google Site Search. Currently, there is one major obstruction: we require authentication for access to our documentation and Google cannot crawl and index pages that require authentification.
The relevant files needed to run Swish-e are:
The Swish-e configuration file directs the search engine on how the build the search index. This includes where to start as well as what files to ignore and how to interpret search parameters. Our swish-e configuration file is located:
/search/swish.conf
This configuration is tells Swish-e to begin in the current directory, to index only html pages, includes all letters in the alphabet and the underscore symbol.
To improve search time, Swish-e uses an index file. This file creates a hash of the contents of the pages that will be available to search. To create the search index, you must do this from the web server (little). Navigate to the root directory of the docs, then run the following command at the prompt:
/usr/bin/swish-e -c ./search/swish.conf
This will generate the following files: index.swish-e and index.swish-e.prop. They will live in the root directory of the documentation directory.
Now we have generated all the necessary elements for Swish-e to perform a query. We can launch a query. In the HOOPS Exchange documentation, each page as a search box at the top right. When a user enters a set of parameters for search, the form launches the following script:
http://developer.techsoft3d.com/cgi/swish-hoops3dx.cgi
The swish-hoops3dx.cgi script gather the query parameters and then passes it onto Swish-e. It then retrieves the query results. To display the results, it called TemplateHOOPS3DX.pm passing the results.
TemplateHOOPS3DX.pm is the perl module that assembles the query results in a html page. This is a relatively simple script. It builds a page with a generic HOOPS logo followed by a form that display the original search parameters with more advanced options. Finally, it display the search results with the search paramaters highlighted in each result.