UC Santa CruzInformation Technology Services

Index/search your web pages

If your pages are all on the same machine (e.g. in one or more directories under AFS) on the ITS compute servers, you can use SWISH-E and the websearch interface. The two step process to generate a search page is explained below.

1. Index your pages with SWISH-E

Create the following file (feel free to copy the file to your locker, and modify it to suit your needs):

myindex.conf
This is the configuration file for SWISH-E, the back-end indexing mechanism. It lists which directory needs to be indexed, and which file types to index and which files to avoid indexing. The configuration file has extensive comments to help you configure the indexing correctly.
Be sure to make the file publicly readable, and the directory readable by the web server:
  % chmod a+r myindex.conf
  % fs sa . wwwadmin.bombalurina read

Once you've set up your myindex.conf file, type:

  % swish-e -c myindex.conf
to start indexing your pages (on Athena, you may also need to give the command add search to attach the search locker where the swish-e command is kept). This will create a file called myindex.swish which is typically 10-15% of the size of the material being indexed. You'll need to give this command whenever the contents of your pages change.

2. Set up your search page with websearch

Create the following file (feel free to copy the file to your locker, and modify its contents to suit your needs):
myindex.rc
This is the configuration file for websearch.pl, the front-end. It tells swish-e which index file to use, and how the search form should look.
Be sure to make the file publicly readable and the directory readable by the web server:
  % chmod a+r myindex.rc
  % fs sa . wwwadmin.bombalurina read

Now insert the following lines in the page where you want the search box to appear (change the USERNAME to your own):


  <form method="POST" action="/search/cgi-bin/websearch.pl">
    <input type=hidden name=conffile
      value="/afs/cats/users/X/USERNAME/public_html/myindex.rc">

    <p>
    Enter keyword(s):<br>
    <input type=text name="keywords" size=30>
    <input type=submit value="  Search  ">

  </form>

Here are some additional sample forms to show you other ways to set up your own search pages.