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.4k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Haystack + ElasticSearch
Gilang Chandrasa
June 29, 2013
More Decks by Gilang Chandrasa
See All by Gilang Chandrasa
Docker + Django
gchandrasa
2
340
An Introduction to Celery
gchandrasa
8
5.2k
Other Decks in Programming
See All in Programming
Oxcを導入して開発体験が向上した話
yug1224
4
360
代数的データ型って何が嬉しいの? #frontend_phpcon_do
kajitack
8
3.8k
Datadog × OpenTelemetry 入門と実践のあいだ
kn_to_maxpno
1
180
これからAgentCoreを触る方へトレンドはGatewayです
har1101
6
450
メソッドのジェネリクスでGoの夢は広がるか? / Kyoto.go #65
utgwkk
3
1k
LLM本来の能力を解き放つサンドボックス技術とAI民主化への適用
yukukotani
3
4.7k
AIキャラアプリkaiwaの低遅延音声通話基盤をどう作ったか - AWS Gravitonで支える低遅延・低コストAI Agent基盤
mogamit
0
150
自作OSでスライド発表する
uyuki234
1
3.5k
LLMによるContent Moderationの本番運用の裏側と品質担保への挑戦
suikabar
3
810
軽量Java基盤の設計 DIコンテナに頼らない、長期保守と1秒起動の実現 JJUG CCC 2026 Spring
macha64
0
620
SLOをサービス品質の共通言語にするために 取り組んできたこと
wakana0222
0
210
気圧・高度・GPSを記録&可視化するアプリ「Koudo」を作った話
hjmkth
1
330
Featured
See All Featured
Chasing Engaging Ingredients in Design
codingconduct
0
230
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
650
SEO for Brand Visibility & Recognition
aleyda
0
4.6k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
410
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
880
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
340
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
67
56k
Designing for humans not robots
tammielis
254
26k
Navigating Weather and Climate Data
rabernat
0
260
Become a Pro
speakerdeck
PRO
31
6k
So, you think you're a good person
axbom
PRO
2
2.1k
Statistics for Hackers
jakevdp
799
230k
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