File: install-xapian.txt

package info (click to toggle)
cyrus-imapd 3.0.8-6%2Bdeb10u6
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 61,500 kB
  • sloc: ansic: 189,141; perl: 10,435; javascript: 9,404; sh: 6,159; yacc: 2,199; makefile: 1,971; cpp: 926; python: 361; lex: 320; awk: 303; asm: 262; xml: 1
file content (71 lines) | stat: -rw-r--r-- 2,430 bytes parent folder | download | duplicates (2)
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
.. _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 XAPIAN_CONFIG="$CYRUSLIBS/bin/xapian-config-1.5"

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

.. _configuring-xapian:

Configuring Xapian
==================

Xapian requires a running :cyrusman:`squatter(8)` instance:

* In :cyrusman:`cyrus.conf(5)` set up a daemon squatter to run: ::

    START {
      # 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: default
    defaultsearchtier: t1
    partition-default: /var/cyrus/spool
    t1searchpartition-default: /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