浙江省高等学校教师教育理论培训

微信搜索“毛凌志岗前心得”小程序

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
  12653 随笔 :: 2 文章 :: 617 评论 :: 608万 阅读

Haystack - Search for Django

Search doesn't have to be hard. Haystack lets you write your search
code once and choose the search engine you want it to run on. With a
familiar API that should make any Djangonaut feel right at home and
an architecture that allows you to swap things in and out as you need
to, it's how search ought to be.
Haystack is
BSD licensed,
plays nicely with third-party apps without needing to modify the
source and supports Solr,
Elasticsearch,
Whoosh and
Xapian.

Get started

  1. Install the package:

     

    1. Latest stable (1.2.6) off PyPI: pip install django-haystack
    2. Latest dev (2.0.0-beta) off GitHub: pip install -e git+https://github.com/toastdriven/django-haystack.git@master#egg=django-haystack
  2. Add haystack to your INSTALLED_APPS.
  3. Create search_indexes.py files for your models.
  4. Setup the main SearchIndex via autodiscover.
  5. Include haystack.urls to your URLconf.
  6. Search!
posted on   lexus  阅读(323)  评论(0编辑  收藏  举报
点击右上角即可分享
微信分享提示