Skip to content
Chris Churas edited this page Jun 12, 2020 · 2 revisions

How it works

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_APPS tuple in settings/base.py of this repo.

  • HAYSTACK_CONNECTIONS is also specified in settings/base.py of this repo. This directs the Haystack to use a particular backend search engine.

  • A PATH parameter 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.py in this repo:

    url(r'^search', include('haystack.urls')),

  • The command python manage.py rebuild_index from the base of the project creates the index in folder whoosh_index in the base directory.

  • Indexes are saved in the search database in as per the template created in templates/search/indexes/apps/app_text.txt and in templates/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.

Clone this wiki locally