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.5k
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
350
An Introduction to Celery
gchandrasa
8
5.2k
Other Decks in Programming
See All in Programming
2年かけて Deno に DOMMatrix を実装した話 / How I implemented DOMMatrix in Deno over two years
petamoriken
0
220
自動化したのに回らない テスト運用の壁―AI時代の品質責任と生産性
mfunaki
0
360
What's New in Android 2026
veronikapj
0
270
片田舎のおっさん、 Swift Buildのダイアモンド問題解決の不具合修正PRを出すが、解決方法がキャッシュをしないようにすることであり、ビルド時間が伸びると言われてマージされないので高速化もする/swiftbuild
yimajo
0
220
MySQLとPostgreSQLって何が違うの?
akagami
0
120
夏だ!祭りだ!祭りとはドメインモデリングでは?
ryugen04
0
350
S3 を使うアプリケーションをローカル完結で動かすことに全力を注いでみた / Running S3 Apps Offline
contour_gara
0
570
不幸な GC
chencmd
0
470
Flow は今どうなっているか
mizdra
PRO
0
670
わからない話を追いかけたら、プログラミング言語を作る側にいた
ydah
3
530
30年振りにコンパイラの定数整数除算を改善した
herumi
7
3.5k
為什麼你並不需要ViewModel / No, you don't need a ViewModel
lovee
1
510
Featured
See All Featured
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
A Soul's Torment
seathinner
6
3.5k
A Tale of Four Properties
chriscoyier
163
24k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
SEO for Brand Visibility & Recognition
aleyda
0
4.7k
Abbi's Birthday
coloredviolet
3
9.4k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
6.1k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
GitHub's CSS Performance
jonrohan
1033
470k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
580
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.4k
Producing Creativity
orderedlist
PRO
348
40k
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