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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
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
TerraformとStrands AgentsでAmazon Bedrock AgentCoreのSSO認証付きエージェントを量産しよう!
neruneruo
4
2.6k
Data-Centric Kaggle
isax1015
2
700
KIKI_MBSD Cybersecurity Challenges 2025
ikema
0
1.2k
SourceGeneratorのススメ
htkym
0
150
Denoのセキュリティに関する仕組みの紹介 (toranoana.deno #23)
uki00a
0
250
なるべく楽してバックエンドに型をつけたい!(楽とは言ってない)
hibiki_cube
0
130
[KNOTS 2026登壇資料]AIで拡張‧交差する プロダクト開発のプロセス および携わるメンバーの役割
hisatake
0
130
AI Agent Tool のためのバックエンドアーキテクチャを考える #encraft
izumin5210
6
1.7k
16年目のピクシブ百科事典を支える最新の技術基盤 / The Modern Tech Stack Powering Pixiv Encyclopedia in its 16th Year
ahuglajbclajep
5
930
AIによるイベントストーミング図からのコード生成 / AI-powered code generation from Event Storming diagrams
nrslib
2
1.6k
Implementation Patterns
denyspoltorak
0
260
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
200
Featured
See All Featured
Odyssey Design
rkendrick25
PRO
0
470
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
61
49k
Color Theory Basics | Prateek | Gurzu
gurzu
0
190
Rebuilding a faster, lazier Slack
samanthasiow
85
9.4k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
260
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
52
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
560
A Soul's Torment
seathinner
5
2.2k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
0
130
Faster Mobile Websites
deanohume
310
31k
Side Projects
sachag
455
43k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
150
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