xapian-haystack 1.1.5beta

A Xapian backend for Haystack


xapian-haystack is a backend for use with the Django Haystack search API and the Xapian search engine.


  • Python 2.4 (May work with 2.3, but untested)
  • Django 1.0.x
  • Django-Haystack 1.1.X (If you wish to use django-haystack 1.0.X, please use xapian-haystack 1.0.X)
  • Xapian 1.0.13+ (May work with earlier versions, but untested)
  • mod_wsgi 1.3.X


  • Due to an issue with mod_python possibly causing deadlocks with Xapian (issue #364), when Python is not invoked through the "main interpreter", mod_python is not supported with xapian-haystack. It may work, with some tweaking, but your mileage will vary.
  • Because Xapian does not support simultaneous WritableDatabase connections, it is strongly recommended that users take care when using RealTimeSearchIndex. If there is a possibility of simultaneous write attempts on the database, keep in mind that they are likely to trigger multiple reindex attempts on the search index. If this occurs an DatabaseLockError exception will be raised by Xapian. To avoid this, either set WSGIDaemonProcess processes=1 or use some other way of ensuring that there are not multiple attempts to write to the indexes. Alternatively, use SearchIndex and a cronjob to reindex content at set time intervals (sample cronjob can be found here) or derive your own SearchIndex to implement some other form of keeping your indexes up to date. A good alternative is to use a QueuedSearchIndex.


  1. Copy or symlink xapian_backend.py into haystack/backends/ or install it by running one of the following commands:

    python setup.py install


    pip install xapian-haystack


    easy_install xapian-haystack

  2. Add HAYSTACK_XAPIAN_PATH to settings.py



The easiest way to test xapian-haystack is to symlink or copy the xapian_haystack/tests folder into the haystack/tests folder so that your source tree resembles this layout:

    |       |
    |       +---backends
    |              |
    |              +---solr_backend.py
    |              +---whoosh_backend.py
    |              +---xapian_backend.py
            |    |
            |    +---[...]
            |       |
            |       +---[...]

Once this is done, the tests can be executed in a similar fashion as the rest of the Haystack test-suite:

django-admin.py test xapian_tests --settings=xapian_settings


The latest source code can always be found here: github.com/notanumber/xapian-haystack


xapian-haystack is maintained by David Sauve, and is funded by Trapeze.


xapian-haystack is Copyright (c) 2009-2010 David Sauve, Trapeze. It is free software, and may be redistributed under the terms specified in the LICENSE file.

Questions, Comments, Concerns:

Feel free to open an issue here: github.com/notanumber/xapian-haystack/issues Alternatively, ask questions on the django-haystack mailing list or irc channel.



David Sauve




  • Framework :: Django
  • Intended Audience :: Developers
  • Development Status :: 4 - Beta
  • License :: OSI Approved :: GNU General Public License (GPL)
  • Topic :: Internet :: WWW/HTTP :: Indexing/Search
File Type Python Version Uploaded On Downloads
xapian-haystack-1.1.5beta.tar.gz Source Dec. 20, 2010 21,759
Version Release Date
1.1.5beta Dec. 20, 2010
1.1.4beta Dec. 7, 2010
1.1.3beta Jan. 27, 2010
1.1.2beta Jan. 16, 2010
1.1.1beta Dec. 9, 2009
1.1.0beta Dec. 7, 2009
1.0.2beta Aug. 27, 2010
Date Package Version Action
Aug. 25, 2015, 1:01 a.m. xapian-haystack 1.1.4beta Release Created
Aug. 25, 2015, 1:01 a.m. xapian-haystack 1.1.1beta Release Created
Aug. 25, 2015, 1:01 a.m. xapian-haystack 1.1.5beta Release Created
Aug. 25, 2015, 1:01 a.m. xapian-haystack 1.1.3beta Release Created
Aug. 25, 2015, 1:01 a.m. xapian-haystack 1.1.2beta Release Created
Aug. 25, 2015, 1:01 a.m. xapian-haystack 1.1.0beta Release Created
Aug. 25, 2015, 1:01 a.m. xapian-haystack 1.0.2beta Release Created
Aug. 25, 2015, 1:01 a.m. xapian-haystack Package Created