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 must have enough privileges 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.2

We hope UdmSearch should 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 is
     sometimes required.


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

2. Configure the package

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

Directory            Contents

bin                  search.cgi, search.php3
etc                  indexer.conf-dist, other *.conf samples, search.htm-dist
man                  indexer.1, indexer.conf.5
sbin                 indexer
doc		     Various documentation

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

	shell> CFLAGS="-O7 -mpentium"
	
_before_ running configure.

If you have any problems with configure, see section 'Installation problems'.


3. Build and install the package.

	shell>make
	shell>make install

If you have problems doing make, see section 'Installation problems'

4. Create mysql database 'udmsearch':

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

	shell>mysqladmin create udmsearch

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

If you are installing UdmSearch for the first time:
	shell>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

	shell>mysql udmsearch < alter20-21.txt

or, to upgrade from UdmSearch 1.x or earlier, run

	shell>mysql udmsearch < alter19-20.txt
	shell>mysql udmsearch < alter20-21.txt

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

	shell>mysql udmsearch <stop.yourlang(s).txt

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. Change dir to '/usr/local/UdmSearch/etc' (or to 'etc' directory
under UdmSearch installation directory).

Copy indexer.conf-dist to indexer.conf and edit it. See man indexer.conf
for description. indexer.conf-dist is fully commented as well.

Copy search.htm-dist to search.htm and edit. See doc/README.templates for
details.

7. 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).

8. Now it's time to start indexing. Change dir to 'sbin' directory of
UdmSearch installation and run

	shell>./indexer

For more information see files in doc subdirectory.


Adding ispell support (optional)
================================
  UdmSearch produces different word forms by using ipsell
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

Here is a sample how to install english support. 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:
shell>indexer -L en -A enslish.aff

4) Import british (or american if you prefer) dictionary:
shell>indexer -L en -D british.xlg

Note, that step 4 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 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':

     shell> rm config.cache
     shell> make clean

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

	shell>gmake
	shell>gmake install

     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>.
