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
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Gilang Chandrasa
June 29, 2013
Programming
2.4k
2
Share
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.1k
Other Decks in Programming
See All in Programming
「効かない!」依存性注入(DI)を活用したAPI Platformのエラーハンドリング奮闘記
mkmk884
0
320
それはエンジニアリングの糧である:AI開発のためにAIのOSSを開発する現場より / It serves as fuel for engineering: insights from the field of developing open-source AI for AI development.
nrslib
1
830
Nuxt Server Components
wattanx
0
260
Don't Prompt Harder, Structure Better
kitasuke
0
650
How Swift's Type System Guides AI Agents
koher
0
200
Swift Concurrency Type System
inamiy
0
420
ふりがな Deep Dive try! Swift Tokyo 2026
watura
0
170
20260320登壇資料
pharct
0
170
セグメントとターゲットを意識するプロポーザルの書き方 〜採択の鍵は、誰に刺すかを見極めるマーケティング戦略にある〜
m3m0r7
PRO
0
390
LM Linkで(非力な!)ノートPCでローカルLLM
seosoft
0
450
アーキテクチャモダナイゼーションとは何か
nwiizo
17
4.7k
CDK Deployのための ”反響定位”
watany
3
630
Featured
See All Featured
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8k
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.2k
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.4k
Odyssey Design
rkendrick25
PRO
2
570
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
430
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
160
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
120
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
HDC tutorial
michielstock
1
610
Why Our Code Smells
bkeepers
PRO
340
58k
BBQ
matthewcrist
89
10k
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