UdmSearch Installation notes
============================

Requirements
============

Note that you must have MySQL version 3.22.xx or later installed before
installing UdmSearch (3.21.xx will not work for you!). You can find MySQL
at http://www.mysql.com/
You also should have enough permissions to create new MySQL database 
or to write to already existing one.


Supported operating systems
===========================

We use GNU Autoconf so it is possible to compile and use UdmSearch on
almost every modern UNIX system with a C compiler without any modifications.
We develop the software on FreeBSD 3.1 and Linux 2.2

Currently known systems UdmSearch has been sucessfully compiled and tested are:

    * FreeBSD 2.2.5
    * FreeBSD 3.x
    * Linux 2.x

We assume UdmSearch will work on other Unix platforms as well. Please report
sucessful platforms to devel@search.udm.net

Installing UdmSearch
====================

You need the following tools to build and install UdmSearch from source:

   * GNU gunzip to uncompress the distribution.

   * A reasonable tar to unpack the distribution. GNU tar is known
     to work.

   * A working ANSI C compiler. GNU gcc is known to work.

   * A good make program. GNU make is always recommended and
     sometimes required.


1. Unpack the distribution and change dir into the top-level directory 
of the unpacked distribution.

2. Configure the package

	sh$ ./configure
	
By default, the UdmSearch is installed in '/usr/local/UdmSearch'
in the following subdirectories:

Directory            Contents

bin                  search.cgi, search.php3, morph.php3
sbin                 indexer
etc                  indexer.conf-dist, search.htm-dist
man                  indexer.1, indexer.conf.5
doc		     Various documentation
doc/samples	     Different configuration file samples

If you have no permissions to write to that directory or just want to install
UdmSearch to another location, please use configure with --prefix option.
You can see all available options with ./configure --help

It you want to provide some specific flags to C compiler (for example,
'-O7 -mpentium' to build highly optimized binary for Pentium processor
if you use egcs/pgcc), you can do so using command

	sh$  CFLAGS="-O7 -mpentium"
	
_before_ running configure.

If you run into problems with configure, please see section
'Installation problems'.


3. Build and install the package.

	sh$ make
	sh$ make install

If you run into problems while doing make, please see section
'Installation problems'

4. Create mysql database 'udmsearch'.

	sh$ mysqladmin create udmsearch

You can also use existing MySQL database, skip this step in this case.

5. reate tables.

Change dir to 'create' directory of the distribution and create 
tables structure.

If you are installing UdmSearch for the first time:
	sh$ mysql udmsearch < create.txt

IMPORTANT: If you already use UdmSearch and want to upgrade from 
UdmSearch 2.0 or earlier while keep existing data, please DO NOT
use create.txt.
Instead, to upgrade from UdmSearch 2.0, run

	sh$ mysql udmsearch < alter20-21.txt

or, to upgrade from UdmSearch 1.x, run

	sh$ mysql udmsearch < alter19-20.txt
	sh$ mysql udmsearch < alter20-21.txt

If you want to provide support for stop words, please do

	sh$ mysql udmsearch <stop.lang1.txt
	sh$ mysql udmsearch <stop.lang2.txt

for all languages that you are planning to support.

Stop-list is a list of common words (such as 'am','he','in' etc.)
that presents in almost every document, have little information value and
therefore should not be stored in database.

If there is no stop-list for your language in this distribution, you are
welcome to compose one and send it to devel@search.udm.net - it will be
included in next distribution.

6. Installing search scripts.

Copy search.cgi to your web-server cgi-bin directory or make Apache alias
to UdmSearch bin directory. If you prefer PHP3 use search.php3 or 
morph.php3 instead.

There is also search.phtml for php/fi-2 available (but no longer maintained).

7. Adding ispell support (optional)

UdmSearch produces different word forms by using ispell
affixes and dictionaries. Ispell files for some languages 
can be found at udmsearch site 
http://search.udm.net/about/Download/ispell/

Links to international ispell files can be found at 
http://fmg-www.cs.ucla.edu/fmg-members/geoff/ispell-dictionaries.html

Below is an example of english support installation. Installation for
other languages should be done in the same way.

1) Download ispell-english.zip from 
http://search.udm.net/about/Download/ispell/

2) Unpack it with unzip

3) Import affix file:

	sh$ indexer -L en -A enslish.aff

4) Import british (or american if you prefer that) dictionary:

	sh$ indexer -L en -D british.xlg

Note that this step will take a minute or two.

That's all. Now have fun. Open search.cgi or morph.php3
in your browser and try to search for the word 'test'.
tested, tester, testers, testing, testings, tests will be 
found as well.

If you don't want different word forms support, just
do not install ispell files.

Installation problems
=====================

   * Each time you run 'configure', you must run 'make' again to
     recompile.

     To prevent old configuration information or object files from being
     used, run these commands before re-running 'configure':

             sh$ rm config.cache
             sh$ make clean

   * If your compile fails with make errors, this can be because
     you are using the wrong version of make.
     The behavior of Solaris and FreeBSD make is slightly different 
     from GNU make. If you have make-related problems, 
     you should use GNU make instead, often installed as gmake.
     So, use gmake instead of make in step 3 after configure:

     GNU 'make' version 3.77 is known to work.

If above information doesn't help you, please feel free to contact UdmSearch
developers <devel@search.udm.net>.
