Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up for free
explore your data with elasticsearch
Elasticsearch Inc
October 12, 2013
Technology
3
740
explore your data with elasticsearch
A talk given at RuPy 2013
Elasticsearch Inc
October 12, 2013
Tweet
Share
More Decks by Elasticsearch Inc
See All by Elasticsearch Inc
OSCON: Scaling a distributed engineering team from 50-250
elasticsearch
13
1.3k
Stuff a Search Engine Can Do
elasticsearch
17
1.6k
Using Elastic to monitor anything
elasticsearch
3
1.5k
Log all the things!
elasticsearch
4
1k
Why Elastic? @ 50th Vinitaly 2016
elasticsearch
5
1.9k
What's New In Elasticland?
elasticsearch
3
760
Kibana, Timelion, Graph Meetup
elasticsearch
3
740
Elastic for Time Series Data and Predictive Analytics
elasticsearch
4
2.8k
Elastic 2.0
elasticsearch
1
700
Other Decks in Technology
See All in Technology
CUEとKubernetesカスタムオペレータを用いた新しいネットワークコントローラをつくってみた
hrk091
0
190
ラズパイとGASで加湿器の消し忘れをLINEでリマインド&操作
minako__ph
0
110
IoT から見る AWS re:invent 2022 ― AWSのIoTの歴史を添えて/Point of view the AWS re:invent 2022 with IoT - with a history of IoT in AWS
ma2shita
0
130
マネーフォワードクラウドを支える事業者基盤
machisuke
0
220
Kubernetes_EKSに入門してみる
toru_kubota
0
220
OVN-Kubernetes-Introduction-ja-2023-01-27.pdf
orimanabu
1
130
Pentesting Password Reset Functionality
anugrahsr
0
180
Virtual Thread - 導入の背景と、効果的な使い方 -
skrb
3
240
WebLogic Server for OCI 概要
oracle4engineer
PRO
3
830
propsのバケツリレー対策でGlobal_Stateを使うその前に
taro28
8
1.7k
Google Cloud Updates 2022/12/01-12/15
no24oka
1
150
インフラ技術基礎勉強会 開催概要
toru_kubota
0
120
Featured
See All Featured
Rails Girls Zürich Keynote
gr2m
87
12k
Robots, Beer and Maslow
schacon
154
7.3k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
226
16k
jQuery: Nuts, Bolts and Bling
dougneiner
57
6.6k
Typedesign – Prime Four
hannesfritz
34
1.5k
Statistics for Hackers
jakevdp
785
210k
Visualization
eitanlees
128
12k
How STYLIGHT went responsive
nonsquared
89
4.2k
Debugging Ruby Performance
tmm1
67
11k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
24
4.5k
What's new in Ruby 2.0
geeforr
336
30k
What the flash - Photography Introduction
edds
64
10k
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
Let us pray to the demo gods!
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 • ….
percolator # curl -XPUT localhost:9200/_percolator/conf/meet -d '{ "query" : {
"term" : { "tile" : "meetup" } } }' # curl -XPUT localhost:9200/conf/event/_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!