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
explore your data with elasticsearch
Search
Elasticsearch Inc
October 12, 2013
Technology
3
790
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.5k
Stuff a Search Engine Can Do
elasticsearch
17
1.7k
Using Elastic to monitor anything
elasticsearch
3
1.5k
Log all the things!
elasticsearch
4
1.2k
Why Elastic? @ 50th Vinitaly 2016
elasticsearch
5
2k
What's New In Elasticland?
elasticsearch
3
1k
Kibana, Timelion, Graph Meetup
elasticsearch
3
810
Elastic for Time Series Data and Predictive Analytics
elasticsearch
4
3.1k
Elastic 2.0
elasticsearch
1
760
Other Decks in Technology
See All in Technology
Connection-based OAuthから学ぶOAuth for AI Agents
flatt_security
0
490
なぜ あなたはそんなに re:Invent に行くのか?
miu_crescent
PRO
0
230
Oracle Database@AWS:サービス概要のご紹介
oracle4engineer
PRO
2
500
Claude Skillsの テスト業務での活用事例
moritamasami
1
120
Strands Agents × インタリーブ思考 で変わるAIエージェント設計 / Strands Agents x Interleaved Thinking AI Agents
takanorig
6
2.4k
アプリにAIを正しく組み込むための アーキテクチャ── 国産LLMの現実と実践
kohju
1
260
コールドスタンバイ構成でCDは可能か
hiramax
0
120
Entity Framework Core におけるIN句クエリ最適化について
htkym
0
140
AI駆動開発ライフサイクル(AI-DLC)の始め方
ryansbcho79
0
260
「駆動」って言葉、なんかカッコイイ_Mitz
comucal
PRO
0
120
AWSに革命を起こすかもしれない新サービス・アップデートについてのお話
yama3133
0
530
Oracle Database@Google Cloud:サービス概要のご紹介
oracle4engineer
PRO
1
790
Featured
See All Featured
4 Signs Your Business is Dying
shpigford
187
22k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
150
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.6k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
65
35k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
32
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
1
270
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.8k
The Limits of Empathy - UXLibs8
cassininazir
1
200
Leo the Paperboy
mayatellez
0
1.3k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
0
2.2k
Building Flexible Design Systems
yeseniaperezcruz
330
39k
How to train your dragon (web standard)
notwaldorf
97
6.5k
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!