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

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

Note that you must have database already installed before
installing UdmSearch.

You also should have enough permissions to create new database 
or to write into already existing one.

MySQL notes:
We tested UdmSearch with 3.22.x MySQL version, 3.21.xx will 
not work for you!
MySQL-3.23.2 will not work too, it has a bug in sum() fuction,
so you will have to upgrade to later or downgrade to older 
MySQL version.

PostgreSQL notes:
If you want to build UdmSearch with PostgreSQL, release 6.5.x required,
which have LIMIT SQL clause.

iODBC notes:
iodbc-2.50.22a is known to work

unixODBC notes:
unixODBC-1.7 is known to work

Solid notes:
03.00.0043 version is known to work

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
    * sun4u sparc SunOS 5.6
    * Solaris7 x86

We hope 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 --with-mysql
or
	sh$ ./configure --with-pgsql
or
	sh$ ./configure --with-msql
depending on what database you prefer.


By default, the UdmSearch is installed in '/usr/local/UdmSearch'
in the following subdirectories:

Directory            Contents

bin                  search.cgi
sbin                 indexer
etc                  indexer.conf-dist, search.htm-dist
man                  indexer.1, indexer.conf.5
doc		     Various documentation
doc/samples	     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.

To compile UdmSearch on FreeBSD with Solid in old aout format,
use
	sh$ CFLAGS="-aout"
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 database 'udmsearch'.

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

MySQL:
	sh$ mysqladmin create udmsearch

PostgreSQL:
	sh$ createdb udmsearch

miniSQL:
	sh$ msqladmin create udmsearch

Use database specific documentation for ODBC databases.


5. Create tables.

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

MySQL:
	sh$ mysql udmsearch < create.txt

PostgreSQL:
	sh$ psql udmsearch <create.txt

miniSQL:
	sh$ msql udmsearch <create.txt

Solid:
	sh$ solsql "tcp localhost 1313" dba dba create.txt


IMPORTANT for MySQL users: If you already use UdmSearch and want 
to upgrade from UdmSearch 2.0 or earlier with keeping 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
or
	sh$ psql udmsearch <stop.lang1.txt
	sh$ psql 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/MySQL use search.php3 or 
morph.php3 instead. You can use perl frontend as well. It is included in 
contrib/udmperl directory of UdmSearch distribution.

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

7. Adding ispell support (optional)

Ispell support is implemented for MySQL and PostgreSQL. MySQL
version work very fine.

PostgreSQL version requires some optimization stuff. It currently
takes about 4 second to get all word forms.

UdmSearch produces different word forms by using ispell
affixes and dictionaries. Ispell files for some languages 
can be found at udmsearch site 
http://mysearch.udm.net/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://mysearch.udm.net/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>.
