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
Integrating Sphinx and Elasticsearch
Search
Markus H
February 12, 2015
Programming
0
170
Integrating Sphinx and Elasticsearch
This is a lightning talk presentation I gave a the Python Users Berlin meetup on Feb 12, 2015
Markus H
February 12, 2015
Tweet
Share
More Decks by Markus H
See All by Markus H
🐍 ❤️ 🦀 — Python loves Rust
markush
0
240
Knock! Knock! Who's There?
markush
0
65
An Introduction To Kubernetes ☸
markush
0
93
Writing Safe Database Migrations (DjangoCon Europe 2021)
markush
0
14k
A Pony On The Move: How Migrations Work In Django 🐎
markush
0
13k
All Hands on Deck — Handling Security Issues
markush
0
14k
Logging Rethought 2: The Actions of Frank Taylor Jr. (PyCon UK 2019)
markush
0
60
Logging Rethought 2: The Actions of Frank Taylor Jr. (PyCon Australia 2019)
markush
1
210
Logging Rethought 2: The Actions of Frank Taylor Jr. (DjangoCon Europe 2019)
markush
0
13k
Other Decks in Programming
See All in Programming
Blazing Fast UI Development with Compose Hot Reload (Bangladesh KUG, October 2025)
zsmb
2
450
Amazon ECS Managed Instances が リリースされた!キャッチアップしよう!! / Let's catch up Amazon ECS Managed Instances
cocoeyes02
0
120
CSC509 Lecture 10
javiergs
PRO
0
160
オンデバイスAIとXcode
ryodeveloper
0
370
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
680
AI時代に必須!状況言語化スキル / ai-context-verbalization
minodriven
2
300
pnpm に provenance のダウングレード を検出する PR を出してみた
ryo_manba
1
170
社会人になっても趣味開発を続けたい! / traPavilion
mazrean
1
120
EMこそClaude Codeでコード調査しよう
shibayu36
0
550
SidekiqでAIに商品説明を生成させてみた
akinko_0915
0
110
data-viz-talk-cz-2025
lcolladotor
0
110
テーブル定義書の構造化抽出して、生成AIでDWH分析を試してみた / devio2025tokyo
kasacchiful
0
360
Featured
See All Featured
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
2
250
Reflections from 52 weeks, 52 projects
jeffersonlam
355
21k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
Typedesign – Prime Four
hannesfritz
42
2.8k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.3k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.5k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
31
2.7k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.2k
Agile that works and the tools we love
rasmusluckow
331
21k
Transcript
Sphinx and Elasticsearch
• elasticsearch-dsl==0.0.3 • Sphinx==1.2.3 Which libraries to use?
def setup(app): app.connect( 'doctree-resolved', index ) Sphinx integration
from elasticsearch_dsl import DocType, String class Document(DocType): title = String(analyzer='snowball',
boost=5) body = String(analyzer='snowball') docname = String(index='not_analyzed') class Meta: index = 'docs' Elasticsearch Document
import hashlib from elasticsearch_dsl.connections import connections connections.create_connection(hosts=['localhost']) def index(app, doctree,
docname): title = app.env.titles[docname].astext() doc = Document( title=title, body=doctree.astext(), docname=docname, ) doc.id = hashlib.md5(docname.encode('utf-8')).hexdigest() doc.save() Index a Document
from elasticsearch_dsl.connections import connections connections.create_connection(hosts=['localhost']) search = Document.search() query =
search.query( 'query_string', query='Migrations', fields=['title', 'body'], ).highlight_options(order='score').highlight('body') results = query.execute() Search
>>> for hit in results: ... print(hit.title) Writing database migrations
Writing your first Django app, part 1 Django documentation FAQ: Databases and models System check framework ... Using the hits
Thank you! markusholtermann.eu @m_holtermann github.com/MarkusH