Intro to Haystack Search

This is a small sample project showing how data is mapped from the ORM to a SearchIndex class as well as optional ways of querying data in the search engine.

It's set up to deploy to Heroku using the Bonsai ElasticSearch add-on, although any similarly configured ElasticSearch backend will work. It is designed loosely around the CIA World Factbook. The Factbook content structure is crappier than I expected when I set out to do this, so if you want to help extract content, fixture file pull requests welcome!

See the code »

Countries list

Just a basic function based Django list view. Uses a manager method to encapsulate the basic search logic.

Check it out »

Default search

Just hooked up the default Haystack search view. The simplest way to add search (documentation).

Check it out »

Customized form

Very little customization, but just enough to show how it can be done. Uses an extended SearchForm to add a field and include it for querying.

Check it out »

Faceted search

Adds faceting of the facetable 'government type' field.

Check it out »

Custom search

Skip the predefined Haystack view and use different form patterns.

Check it out »