-
Notifications
You must be signed in to change notification settings - Fork 24
Haystack
Haystack is a search API for Django based websites, which allow users to use different search backend as per their choice. Appstore uses Haystack and Whoosh for the backend.
-
Haystack has been added to the
INSTALLED_APPStuple insettings/base.pyof this repo. -
HAYSTACK_CONNECTIONSis also specified insettings/base.pyof this repo. This directs the Haystack to use a particular backend search engine. -
A
PATHparameter also needs to be specified in the same script to direct where the index file created by Haystack will be stored for later access while search. -
A url for search via Haystack has been added to
urls.pyin this repo:url(r'^search', include('haystack.urls')), -
The command
python manage.py rebuild_indexfrom the base of the project creates the index in folderwhoosh_indexin the base directory. -
Indexes are saved in the search database in as per the template created in
templates/search/indexes/apps/app_text.txtand intemplates/search/indexes/apps/author_text.txt
NOTE: Changes to database are NOT reflected until a call to python manage.py rebuild_index The current Appstore addresses this by running a daily cronjob to update the index.
Click here for the official documentation.