Xapian - the open source search engine

Introduction

This document is intended to get you going with Xapian, taking you from the point of downloading the code, to getting an example application compiled and running.

Note that Xapian is currently only available in versions targeted for UNIX systems.

Download

The first step is to obtain a copy of the software from the Xapian website.

Unpacking

Use the usual tools to unpack the archives. For example, on a Linux system:
tar zxvf xapian-core-<versionnumber>.tar.gz
tar zxvf xapian-examples-<versionnumber>.tar.gz
These commands should unpack the archives into separate subdirectories ("xapian-core" and "xapian-examples").

Configuring and building Xapian

Xapian uses the GNU automake and autoconf tools. If you only wish to build from the snapshots or make minor alterations, this need not concern you greatly.

These tools generate a shell script called "configure" for each of the archives, which you should run to set up the code for compilation.

A typical build would be done using the commands:

    cd xapian-core
    ./configure
    make
    make install
Various options may be given to the configure script: see the installation documentation within the archive for more details.

By default, Xapian will be installed in directories under /usr/local. This can be altered using the --prefix option to configure.

Configuring and building the examples

The examples can be built in almost exactly the same way as the core library. Simply run:
    cd xapian-examples
    ./configure
    make
Note that we do not currently recommend attempting to install the examples.

configure should automatically find the installed Xapian library: if it doesn't you may need to specify the path to the xapian-config script, by using the --with-xapian-config option to configure.

Note: you must install the Xapian library to be able to link applications with it. In the past we've attempted to allow linking against uninstalled builds of the library, but it's very hard to do it reliably and portably. If you don't have the rights to install libraries in /usr/local/lib (or similar) then you can build Xapian to install under your home directory.

Supposing you had unpacked both xapian and xapian-examples in the same directory, you could use:

    cd xapian-core
    ./configure --prefix=`pwd`/tempinstall --disable-shared
    make
    make install
    cd ../xapian-examples
    ./configure --with-xapian-config=`pwd`/../xapian-core/tempinstall/bin/xapian-config
    make

Check the documentation within the xapian-examples archive for more details on building and running the examples.

Building from CVS

If you wish to help develop Xapian, you may wish to build directly from the CVS repository. Note that this is likely to periodically to contain severe bugs and/or code which will not compile. Details on how to access the CVS repository are available at http://sourceforge.net/cvs/?group_id=26013

The other drawback of CVS is that you will need to generate your own configure script and makefiles. This can be done using the GNU autoconf, automake, and libtool packages: you must have these installed if you wish to work from CVS.

We provide a useful script (buildall) to run all the necessary scripts to generate the project Makefiles. Simply run ./buildall to run all the necessary scripts. This will produce a source tree like the ones in the distribution tarballs, which you can run configure and make on in the usual way.