1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
|
.. _imapinstall-xapian:
====================
Xapian for searching
====================
Cyrus can be configured to use `Xapian <http://xapian.org>`_ to power its searches.
Compiling Xapian for Cyrus
==========================
.. note::
If CJK support is not required in your environment, you can use Cyrus with a
standard upstream Xapian 1.4 release. Skip this section and move straight on to
:ref:`Configuring Xapian <configuring-xapian>`. If you need CJK support, you will
still need to use the cyruslibs Xapian fork and compile from source.
The cyrusimap/cyruslibs repository provides a pre-patched copy of 1.5-dev Xapian, ready for use with Cyrus. We are working on having the patches integrated upstream.
Compiling Xapian requires gcc 4.9 or later.
To build Xapian, fetch the cyruslibs package which comes with pre-patched Xapian and some other
dependencies. They are installed in ``/usr/local/cyruslibs`` by default unless overridden on the
command line.
.. code-block:: bash
export CYRUSLIBS="/usr/local/cyruslibs"
export PKG_CONFIG_PATH="$CYRUSLIBS/lib/pkgconfig:$PKG_CONFIG_PATH"
export LDFLAGS="-Wl,-rpath,$CYRUSLIBS/lib -Wl,-rpath,$CYRUSLIBS/lib/x86_64-linux-gnu"
export PATH="$PATH:$CYRUSLIBS/bin"
git clone git@github.com:cyrusimap/cyruslibs.git
cd cyruslibs
sh build.sh $CYRUSLIBS_DIR
Then follow on with the Cyrus :ref:`compilation instructions <compiling>`, adding ``--enable-xapian`` to the flags to ``./configure``.
Additional dependencies required for Cyrus with Xapian support
==============================================================
When building Cyrus with Xapian support enabled, the following additional
packages are required:
* `rsync <https://rsync.samba.org>`_ (used when compacting databases)
.. _configuring-xapian:
Configuring Xapian
==================
Xapian requires a running :cyrusman:`squatter(8)` instance:
* In :cyrusman:`cyrus.conf(5)` set up a daemon squatter to run: ::
DAEMON {
# run a rolling squatter
squatter cmd="squatter -R"
}
* Enable sync logging: Set ``sync_log: on`` in :cyrusman:`imapd.conf(5)`.
* Add a squatter sync log channel: ``sync_log_channels: squatter`` in :cyrusman:`imapd.conf(5)`.
You also need (at least one) search tier. Add this to :cyrusman:`imapd.conf(5)`.
::
search_engine: xapian
search_index_headers: no
search_batchsize: 8192
defaultpartition: base
defaultsearchtier: t1
partition-base: /var/cyrus/spool
t1searchpartition-base: /var/cyrus/search
If you want to do more complex search tiers and repacking, you'll want to read:
http://lists.tartarus.org/pipermail/xapian-discuss/2014-October/009112.html
|