Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Haystack + ElasticSearch
Search
Gilang Chandrasa
June 29, 2013
Programming
2
2.4k
Haystack + ElasticSearch
Gilang Chandrasa
June 29, 2013
Tweet
Share
More Decks by Gilang Chandrasa
See All by Gilang Chandrasa
Docker + Django
gchandrasa
2
340
An Introduction to Celery
gchandrasa
8
5.1k
Other Decks in Programming
See All in Programming
CSC307 Lecture 04
javiergs
PRO
0
660
360° Signals in Angular: Signal Forms with SignalStore & Resources @ngLondon 01/2026
manfredsteyer
PRO
0
120
CSC307 Lecture 09
javiergs
PRO
1
830
今から始めるClaude Code超入門
448jp
8
8.6k
CSC307 Lecture 07
javiergs
PRO
0
550
MUSUBIXとは
nahisaho
0
130
AI時代の認知負荷との向き合い方
optfit
0
150
生成AIを使ったコードレビューで定性的に品質カバー
chiilog
1
260
Architectural Extensions
denyspoltorak
0
280
Basic Architectures
denyspoltorak
0
660
Oxlint JS plugins
kazupon
1
850
CSC307 Lecture 01
javiergs
PRO
0
690
Featured
See All Featured
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
910
How to Think Like a Performance Engineer
csswizardry
28
2.4k
HDC tutorial
michielstock
1
370
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
410
Between Models and Reality
mayunak
1
180
Practical Orchestrator
shlominoach
191
11k
Ethics towards AI in product and experience design
skipperchong
2
190
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
210
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.3k
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
62
49k
Building an army of robots
kneath
306
46k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.8k
Transcript
Haystack + ElasticSearch Gilang Chandrasa
Django Python PHP ElasticSearch HTML5 Memcache MongoDB Celery NginX Android
Git MySQL PostgreSQL Gilang Chandrasa CSS3
Haystack Why What How
A modular search for Django
lets you write your search code once and choose the
search engine you want it to run on
lets you write your search code once and choose the
search engine you want it to run on Solr, Elasticsearch, Whoosh and Xapian
pip install django-haystack Step 1 Install Haystack
INSTALLED_APPS = [ ... 'haystack', ] HAYSTACK_CONNECTIONS = { 'default':
{ 'ENGINE': '...', }, } Step 2 Configure settings.py
class NoteIndex(indexes.SearchIndex, indexes.Indexable): text = indexes.CharField(document=True, use_template=True) author = indexes.CharField(model_attr='user')
def get_model(self): return Note Step 3 Create search_index.py
{{ object.title }} {{ object.user.get_full_name }} {{ object.body }} Step
4 Create search template
Step 5 Install Search Engine Solr Xapian Whoosh ElasticSearch
Step 6 Indexing python manage.py rebuild_index
Some Advanced Uses Highlighting Autocomplete Boost Rich Content Extraction Spatial
Search
ElasticSearch
ElasticSearch distributed real-time search and analytics engine for the cloud
real time data real time analytics distributed high availability multi
tenancy full text search document oriented conflict management schema free restful API apache 2 open source license per operation persistence built on top apache lucene
Spatial Search within, dwithin, distance, order_by(‘distance’), polygon
location = Point(float(longitude), float(latitude)) SearchQuerySet()\ .dwithin('location', location,D(km=10))\ .distance('location',location)\ .order_by('distance') Search
places within 10km and order by distance
haystacksearch.org elasticsearch.org Further Reading
thank you!
Gilang Chandrasa twitter.com + github.com @gchandrasa