International Vegetarian Union
IVU logo Technical Support

Simple Search


We have installed search engine script - Simple Search from Matt's Script Archive. This allows users to search in English (ascii) only and lists results 'in no particular order'. This has obvious limitations but could be very useful for a local group site in English.

You can see it in action, and try it for yourself, by going to the IVU search page - search ivu.org) - and go to the 'specialist search' section.

If you want to set this up for your own sub-directory you can download the search.zip file which is already set up for use on ivu.org

You just need to put in your sub-directory name at the 'define variables' section, it currently reads:

   # Define Variables
      
      $basedir = '/home/ivu/your-org/';
      $baseurl = 'http://www.ivu.org/your-org/';
      @files = ('*.html','*.htm','articles/','global/');
      $title = "Your Vegetarian Society";
      $title_url = 'http://www.ivu.org/your-org/';
      $search_url = 'index.html';
When altering this be careful not to change any of the quotes, commas etc.
  1. replace 'your-org' with your sub-directory name (the bit that comes after ivu.org) - on lines 1,2 and 5
  2. replace Your Vegetarian Society with your own society's name
  3. line 3 is currently set to search sub-directories called articles and global - replace those with any sub-dir of your site. You must put in all sub-directories - and sub-sub-directories - it will only search the ones listed (do not alter html or htm).

You can now upload your file via telnet or ftp - if using ftp make sure you are using 'ascii' mode.

Permissions

You have to set the 'permissions' for cgi scripts so that they can be used by readers.

If you are using telnet then you should see an option for setting permission, allow all options - read/write/execute.

If you using ftp you should be able to set the permissions from your ftp program, this is how to do it on 'ws_ftp95' - other should be similar:

  1. You need to be logged on with the cgi file showing in the right window (remote system)
  2. highlight the cgi file
  3. right click on it and you will get a drop down list
  4. click on chmod(unix) and you will get a window with check boxes
  5. tick/check all the boxes
  6. click on OK
Input

Your search.cgi file should be working. Now you need to put a box on your page so that readers can type in what they're looking for and hit 'search'.

Copy/paste the HTML below onto your page. It assumes that you are putting it into the same sub-directory as the 'search.cgi' file:


<FORM METHOD="POST" ACTION="search.cgi">
<center>
<b>Search this site:</b><br>
<INPUT TYPE="text" NAME="terms" VALUE="" SIZE=35>
<INPUT TYPE="submit" VALUE="Search!">
<INPUT TYPE="hidden" NAME="boolean" VALUE="AND">
<INPUT TYPE="hidden" NAME="case" VALUE="Insensitive">
</center>
</form>

The result will look like this:
Search this site:

[the above will actually work but will only search this 'tech' section of ivu.org - try the word 'form']

For a more detailed explanation of Simple Search see the ReadMe file on Matt's Script site.