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
Honza Kral - Explore Your Data with Elasticsearch
Search
NewCircle Training
September 20, 2013
Technology
1.5k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Honza Kral - Explore Your Data with Elasticsearch
NewCircle Training
September 20, 2013
More Decks by NewCircle Training
See All by NewCircle Training
Spark: A Coding Joyride | QCon SF 2015
newcircle
0
880
Intro to Spark Streaming
newcircle
1
2k
Artisanal Data on the Web: Using JS and Data to Get Literary 21st Century Style
newcircle
0
690
Java 8 Lambda Expressions & Streams
newcircle
0
630
Macros vs Types
newcircle
0
1.3k
Larry Schiefer - Exploring SDK Add-on for Android Devices
newcircle
0
3k
Scala Collections: Why Not? - Paul Phillps
newcircle
2
9.9k
Dave Smith- Mastering the Android Touch System
newcircle
9
17k
Geoff Matrangola- Migrating Your Apps to the New Gradle Build Process
newcircle
1
1.8k
Other Decks in Technology
See All in Technology
Reliability in the Age of AI: Engineering for AI Velocity
rrreeeyyy
0
120
あなたの AI ワークスペースに、 専門コーダーを連れてくる - Amazon Quick Desktop 最新情報
kawaji_scratch
1
120
10倍の生産性を実現するAI駆動並列エージェントのすべて
kumaiu
4
1.2k
Rancherの紹介&Update情報(RancherJP Online Meetup #09)
yoshiyuki_kono
0
140
MIERUNE JCT 発表資料「宇宙から伊能忠敬ごっこ」
syuchimu
0
200
protovalidate-es を導入してみた
bengo4com
0
160
機械学習を「社会実装」するということ 2026年夏版 / Social Implementation of Machine Learning June 2026 Version
moepy_stats
3
810
LLMと共に進化するプロセスを目指して
ymatsuwitter
12
3.8k
データ基盤をDataformで整えた話 〜 開発環境を添えて 〜
takapy
0
130
日本 Fintech 未来予測レポート 2027〜2028年(手動編集版)
8maki
0
230
なぜ Platform Engineering の土台に Kubernetes を選ぶのか
r4ynode
1
490
2026 TECHFRESH 畢業分享會 - 開發日常大解密!從領域驅動到企業級上線
line_developers_tw
PRO
0
130
Featured
See All Featured
Facilitating Awesome Meetings
lara
57
7k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.9k
Scaling GitHub
holman
464
140k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.5k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
180
New Earth Scene 8
popppiees
3
2.3k
Darren the Foodie - Storyboard
khoart
PRO
3
3.4k
The Cult of Friendly URLs
andyhume
79
6.9k
Claude Code のすすめ
schroneko
67
230k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
Designing for humans not robots
tammielis
254
26k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Transcript
explore your data with elasticsearch Honza Král @honzakral
REST HTTP JSON distributed search analytics real-time scalable open-source Lucene
…
setup # wget elasticsearch.tar.gz # tar xzvf elasticsearch.tar.gz # bin/elasticsearch
# curl localhost:9200
documents # curl -XPUT localhost:9200/stack/question/42 -d '{ “some”: “json” }'
# curl -XGET localhost:9200/stack/question/42 # curl -XDELETE localhost:9200/stack/question/42
search # curl -XGET localhost:9200/_search?q=meetup # curl -XGET localhost:9200/_search -d
'{ “query”: { “query_string”: { “query”: “meetup AND title:python” } } }'
queries & filters # curl -XGET localhost:9200/stack/_search -d '{ “query”:
{ “filtered”: { “query”: { “bool”: { “must”: [ {"multi_match": { "fields": ["title^10", "body"] "query": "python" }}, ], “must_not”: [ {“match”: {“title”: “php”} ] } }, “filter”: { “range”:{"creation_date":{"from":"2013-01-01"}} } } } }'
filter when you can, query if you must
facets # curl -XGET localhost:9200/meetup/_search -d '{ “query”: { ...
}, “facets”: { “monthly_meetups”: { “date_histogram”: { “field”: “event_date”, “interval”: “month” } }, “attendees_per_topic”: { “terms_stats”: { “key_field”: “topic”, “value_script”: “doc['users'].values.length” } } } }'
mix & match curl -XGET http://localhost:9200/dba.stackexchange.com/question/_search -d ' { "query":
{ "custom_score": { "query": { "filtered": { "query": { "bool": { "must": [ {"multi_match": {"fields": ["title^10", "body"], "query": "mysql"}}, { "has_child": { "child_type": "answer", "query": {"match": {"body": "nosql"}} } } ], "must_not": [ {"multi_match": {"fields": ["title", "body"], "query": "nosql"}} ] } }, "filter": { "range": {"creation_date": {"from": "2012-01-01"}} } } }, "script": "(_score + 1) * doc[\"rating\"].value" } }, "fields": ["title", "rating", "creation_date"], "highlight": { "fields": { "title": {"fragment_size" : 50}, "body": {"fragment_size" : 50} } }, "facets": { "tags": { "terms": {"field": "tags"} }, "frequency": { "date_histogram": {"field": "creation_date", "interval": "month"} } } }' Find questions that • Were asked last year • Contain “mysql” in title or body • Don't contain “nosql” • Have answer that has “nosql” in title or body • Include question rating into score calculation • Highlight matches in html • Aggregate over time and tags • ….
Let us pray to the demo gods!
percolator # curl -XPUT localhost:9200/_percolator/stack/meet -d '{ "query" : {
"term" : { "tile" : "meetup" } } }' # curl -XPUT localhost:9200/stack/question/_percolate -d '{ “doc”: { “title”: “SF Python Meetup” } }'
suggester – auto-complete # curl -X POST 'localhost:9200/music/_suggest' -d '{
"song-suggest" : { "text" : "n", "completion" : { "field" : "song_suggest" } } }' { "text" : "Nirvana - Nevermind", "score" : 34.0, "payload" : {"artist_id":2321} }
suggester – did you mean? # curl -XPOST 'localhost:9200/_search' -d
{ "suggest" : { "text" : "Johny Walker", "simple_phrase" : { "phrase" : { ... MAGIC HERE ... "direct_generator" : [ { "field" : "body" } ] } } } }' { "text" : "Johnnie Walker", "score" : 0.314295 }
Is it web scale?
YES!
distributed model
Thanks!