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
- Install the package:
- Latest stable (1.2.6) off PyPI:
pip install django-haystack
- Latest dev (2.0.0-beta) off GitHub:
pip install -e git+https://github.com/toastdriven/django-haystack.git@master#egg=django-haystack
- Add
haystack
to yourINSTALLED_APPS
.- Create
search_indexes.py
files for your models.- Setup the main
SearchIndex
viaautodiscover
.- Include
haystack.urls
to your URLconf.- Search!
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步