SlideShare una empresa de Scribd logo
1 de 11
Searching for owls
Haystack and Whoosh
$ git clone git://github.com/toastdriven/django-haystack.git
$ git clone http://github.com/toastdriven/whoosh.git
Get from Git
● Add haystack to INSTALLED_APPS
● Set HAYSTACK_SEARCH_ENGINE and
HAYSTACK_WHOOSH_PATH
● Add global search_sites.py
● Add search_indexes.py for each app
● ./manage.py reindex
● SearchQuerySet for building searches
● auto_query(), filter() and exclude()
● Consistent with QuerySet
● But feels the wrong model to me
● Install from separate repo
● Set HAYSTACK_SEARCH_ENGINE
● Set HAYSTACK_XAPIAN_PATH
● reindex
Summary
● Convenient and easy to use
● Easy to switch backend
● Unsure about SearchQuerySet
● Awkward to pull data from multiple models
● Only supports one language at a time

Haystack

  • 2.
  • 3.
  • 4.
  • 6. $ git clone git://github.com/toastdriven/django-haystack.git $ git clone http://github.com/toastdriven/whoosh.git Get from Git
  • 7. ● Add haystack to INSTALLED_APPS ● Set HAYSTACK_SEARCH_ENGINE and HAYSTACK_WHOOSH_PATH ● Add global search_sites.py ● Add search_indexes.py for each app ● ./manage.py reindex
  • 8. ● SearchQuerySet for building searches ● auto_query(), filter() and exclude() ● Consistent with QuerySet ● But feels the wrong model to me
  • 9.
  • 10. ● Install from separate repo ● Set HAYSTACK_SEARCH_ENGINE ● Set HAYSTACK_XAPIAN_PATH ● reindex
  • 11. Summary ● Convenient and easy to use ● Easy to switch backend ● Unsure about SearchQuerySet ● Awkward to pull data from multiple models ● Only supports one language at a time