$30 off During Our Annual Pro Sale. View Details »
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
330
An Introduction to Celery
gchandrasa
8
5.1k
Other Decks in Programming
See All in Programming
Evolving NEWT’s TypeScript Backend for the AI-Driven Era
xpromx
0
260
Microservices Platforms: When Team Topologies Meets Microservices Patterns
cer
PRO
1
880
S3 VectorsとStrands Agentsを利用したAgentic RAGシステムの構築
tosuri13
4
250
全員アーキテクトで挑む、 巨大で高密度なドメインの紐解き方
agatan
8
18k
WebRTC と Rust と8K 60fps
tnoho
2
1.9k
FluorTracer / RayTracingCamp11
kugimasa
0
180
Querying Design System デザインシステムの意思決定を支える構造検索
ikumatadokoro
1
1.2k
CloudNative Days Winter 2025: 一週間で作る低レイヤコンテナランタイム
ternbusty
7
1.9k
手軽に積ん読を増やすには?/読みたい本と付き合うには?
o0h
PRO
1
140
[SF Ruby Conf 2025] Rails X
palkan
0
410
テストやOSS開発に役立つSetup PHP Action
matsuo_atsushi
0
140
Building AI Agents with TypeScript #TSKaigiHokuriku
izumin5210
6
1.2k
Featured
See All Featured
Code Review Best Practice
trishagee
73
19k
Thoughts on Productivity
jonyablonski
73
4.9k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
3.8k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
54k
Docker and Python
trallard
46
3.7k
How STYLIGHT went responsive
nonsquared
100
5.9k
How To Stay Up To Date on Web Technology
chriscoyier
791
250k
We Have a Design System, Now What?
morganepeng
54
7.9k
Designing for humans not robots
tammielis
254
26k
Optimizing for Happiness
mojombo
379
70k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.1k
Optimising Largest Contentful Paint
csswizardry
37
3.5k
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