Documentation for ts/tb                Dennis Boone (drbmaint@ibm.cl.msu.edu)
=============================================================================
The ts/tb package consists of several simple programs which allow you to
create and search a keyword index of the user-visible titles in your
Gopher server.

The programs are:
-----------------
    tbnet    Creates the index file
    ts       Executes a search using either tsc or tsp
    tsc      The C version of the search engine
    tsp      The Perl version of the search engine (descendant of
             the old ts
    tb       An ancestor of tbnet; has problems with ftp: and wais:
             type paths

The data file created by tb is called .ts/.tsdata

The package depends on Perl and gopherls.  Gopherls is a feature of the
Gopher server which is not available in earlier versions.  Perl is a
feature of Larry Wall's nightmares.

-----------------------------------------------------------------------------
History of Revisions:
-----------------------------------------------------------------------------
Version		Changes
-------		-------------------------------------
1.0		Initial release
1.1		ts (original Perl version) rewritten to only search 
		the user-visible name field.  Since this rewrite 
		caused a performance problem, the tsc module was written.
1.2		Bugfix to a problem which prevented ts/tb from working in
		a subdirectory.
1.3		Really bugfixed this time, and merged in some changes from
		Buus and Kellem.  Extended command line syntax--see below.
1.4		Addition of tbnet module to replace tb.  Tbnet lets the
		gopher server do the work, eliminating lots of untrustworthy
		pathname munging.  This is really a chiseled version of 
		gophertree, following the lead of the Veronica team.
		Tbnet is now the preferred method for generating the index.
1.5		Minor touchups to tbnet, to prevent it from wandering too
		far.
1.6		Added -f option to tbnet so you can tell it whether to
		follow ftp: paths.
-----------------------------------------------------------------------------
Installation Instructions for ts/tb:
-----------------------------------------------------------------------------
Unpack this stuff into a working directory.  (You already did that, yes?)

Decide which version of the search engine you will use.  Some crude measures
of performance:

	program		words	seconds
	-------		----- 	-------
	old ts		1	2
	old ts		3	6
	tsp		1	10
	tsp		3	12
	tsc		1	.7
	tsc		3	1.7

	All numbers generated on my RS/6000-520 using the timex command.
	The data file used for these timings contained ~5600 lines, and
	~427000 bytes.

If you're going to use the tsc module, build it.

If you're going to use tsp, edit ts and change the second line to say
tsp instead of tsc.

If you're going to use tb instead of tbnet, look at tb, in the comments
near the top, to learn all about the possible problems you could have
with gopherls.  Take care of those issues now.

Set up the directory structure.  Here we'll assume that your Gopher lives
in a directory called /home/gopherdata.  Make the appropriate substitutions
if that is not true, or if you want to index a subtree instead of the
whole thing.

	/home/gopherdata/
		ts			The interface script
		.ts/			The invisible hidey hole for .tsdata
			tsc		Only one of these two is needed, but
			tsp		both won't hurt anything...
			tb		The index builder
			tbnet		The index builder

Usage notes:

	The index will end up in ./.ts/.tsdata

Syntax:

	tbnet host port path
	where:
		host 	is the hostname running the gopher server
		port 	is the port on which the gopher server listens
		path 	[optional] is the path of the subtree you want
			to index.

Build the first index by hand:

	cd /home/gopherdata; .ts/tbnet host port

Make a crontab entry to run tb periodically.  In this example, it runs
every night at 2 am.

	0 2 * * * cd /home/gopherdata; .ts/tbnet host port 

Make /home/gopherdata/.cap/ts (a side file):

	Type=7
	Name=Search Gopher Tree

Make sure that all of the scripts and programs have their execute bit set.
Gopher won't run them if they don't.

Test it.

-----------------------------------------------------------------------------
