Haystack is a general purpose search application for Django. It supports multiple search engine backends with a standardized integration. To install Haystack, use the download link from http://github.com/toastdriven/django-haystack and run setup.py
to install it.
Haystack currently supports three search engine backends: Solr, Whoosh, and Xapian. These backends are specified to Haystack with the Django setting HAYSTACK_SEARCH_ENGINE
. We will be using Haystack with the Whoosh search engine, so our settings file will need to include the following:
HAYSTACK_SEARCH_ENGINE='whoosh' HAYSTACK_WHOOSH_PATH='/path/to/indexes' HAYSTACK_SITECONF='project.search_sites'
As we discussed in the previous section, Whoosh stores indexes in files on the filesystem. When used with Haystack the location of these indexes is defined by the HAYSTACK_WHOOSH_PATH
setting. Now that we've configured our search engine backend, we can move on to configuring the rest of Haystack.
Haystack uses a common...