django-haystack / django-haystack/django-haystack
Xapian index not returning results
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 3.7k
- Forks
- 1.3k
- Avg merge
- 3h 18m
- Merged PRs (30d)
- 3
Description
- Tested with the latest Haystack release
- Tested with the current Haystack master branch
Expected behaviour
I've recently upgraded a site from Django 1.3 to 1.8. I've had Xapian/Haystack search running flawlessly on this site until the upgrade. As a result of the Django upgrade, I was forced to also upgrade Haystack & Xapian-Haystack. The Xapian index is building (see xapian-check below), but isn't returning results. Whoosh works fine with this install, btw...but it's spelling suggestions leave much to be desired, so I really want to get Xapian working again.
$ ./manage.py rebuild_index
...
Indexing 282 products
Here's a look at xapian-check results. Looks ok to me:
$ xapian-check haystack
record:
baseB blocksize=8K items=282 lastblock=10 revision=1 levels=1 root=2
B-tree checked
okay record table structure checked OK
termlist:
baseB blocksize=8K items=564 lastblock=23 revision=1 levels=1 root=2
B-tree checked okay termlist table
structure checked OK
postlist:
baseB blocksize=8K items=8542 lastblock=77 revision=1 levels=1 root=2
B-tree checked okay postlist table
structure checked OK
position:
baseB blocksize=8K items=17532 lastblock=50 revision=1 levels=1 root=2
B-tree checked okay position table
structure checked OK
spelling:
baseB blocksize=8K items=4350 lastblock=16 revision=1 levels=1 root=2
B-tree checked okay spelling table:
Don't know how to check structure
synonym:
Lazily created, and not yet used.
No errors found
Actual behaviour
Getting 0 results from index:
>>> from haystack.query import SearchQuerySet
>>> sqs = SearchQuerySet().all()
>>> sqs.count()
0
Steps to reproduce the behaviour
- Install all necessary requirements: Xapian, Xapian-Haystack, Django-Haystack, etc. (Re)build index. Test.
Configuration
I've tried this on 2 different systems with all sorts of versions and have encountered identical results.
OPERATING SYSTEM 1
- Operating system version: OSX 10.9.5
- Search engine version(s): Xapian 1.2.18-1.3.x
- Python version: 2.7.2
- Django version(s): 1.8.0-1.8.9
- Haystack version(s): 2.4.0-2.5.dev0
OPERATING SYSTEM 2
- Operating system version: CentOS 7.2/Cpanel
- Search engine version(s): Xapian 1.2.18-1.3.x
- Python version: 2.7.11 (virtualenv)
- Django version(s): 1.8.0-1.8.9
- Haystack version(s): 2.4.0-2.5.dev0
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue with the listed Django, Haystack, and Xapian versions, using the rebuild_index command and SearchQuerySet().all().count() shown in the report. Compare the failing Xapian backend with the working Whoosh setup and inspect the index/search configuration. Done means the rebuilt index returns the indexed products instead of zero results.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- django, python
- Domain
- search
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100