1
votes

I want to use Django Haystack with Xapian on my django site for search function. After setting all the necessary settings. I went ahead to input: manage.py rebuild_index , after inputting 'y' I'm getting an error saying:

No module named xapian_backend.

I can see the xapian backend module in site-packages, but I don't know why Django is not seeing it. How Can I make it work?

Below is my settings:

import os
HAYSTACK_CONNECTIONS = {
    'default': {
        'ENGINE': 'haystack.backends.xapian_backend.XapianEngine',
        'PATH': 'C:/Python27/Scripts/myweb/xapian_index',
        'INCLUDE_SPELLING': True,
        'BATCH_SIZE': 100,
    },
}
2
Did you add haystack to your INSTALLED_APPS? - jdi
yes I did. Still not working! - picomon
As well as the xapian_haystack backend, do you have all its Xapian dependencies (the Xapian library, and the Xapian python bindings) installed? If you can run python -c 'import xapian' then these requirements are satisfied. - James Aylett

2 Answers

2
votes

Engine should be:

'ENGINE': 'xapian_backend.XapianEngine',

It is not included in the haystack package, but is separate. It probably still won't work. It doesn't seem to have been upgraded to work with haystack 2.x.

Update: it has now been updated.

0
votes

Solved this issue by copying the xapian_backend.py to haystack/backends as suggested by the readme