introduction to elasticsearch fast lane
TRANSCRIPT
![Page 1: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/1.jpg)
Introduction elasticsearch
@somkiat
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
![Page 2: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/2.jpg)
realtime, search and analytics
engine
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
LuceneDistributed
Scalability
open-sourcedocumentation
JSONAPI
RESTFul
document store
High-Availability
JAVA
Plug-ins
![Page 3: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/3.jpg)
History
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
First version 0.4 in Feb 2010Rewrite from Compass projectAdd scalability
Created by Shay Banon
Current version 1.7.1
![Page 4: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/4.jpg)
Who use ?
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
https://www.elastic.co/use-cases
![Page 5: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/5.jpg)
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
• Search repositories, users, issues, pull request• Search sourcecode 130 พันล้านบรรทัด• Track alerts, events และ logs
![Page 6: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/6.jpg)
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
• ใ้ Full text seach + geolocation• ใ้ feature More-like-this ในการหาคําถาม และ คําตอบ
![Page 7: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/7.jpg)
Clients
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
• Java• PHP• Ruby• Python• JavaScript
• Go• Scala• .Net• Clojure• Erlang
• NodeJS • R
http://www.elasticsearch.org/guide/en/elasticsearch/client/community/current/clients.html
![Page 8: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/8.jpg)
https://github.com/github-sprint3r/elasticsearch_workshop
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
![Page 9: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/9.jpg)
Let’s start
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
![Page 10: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/10.jpg)
Installation …
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
![Page 11: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/11.jpg)
elasticsearch
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
• real-time• distributed• search• analytics
![Page 12: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/12.jpg)
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
mapping
analysis query dsl
![Page 13: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/13.jpg)
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
query dsl• flexible• powerful• query language
![Page 14: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/14.jpg)
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
queries• relevance
filters• boolean yes/no
• full text • exact values• not cached • cached• slower • faster
![Page 15: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/15.jpg)
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
Filter firstquery remaining documents
![Page 16: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/16.jpg)
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
GET /_search
![Page 17: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/17.jpg)
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
GET /_search{ “query” : { . . . }}
![Page 18: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/18.jpg)
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
GET /_search{ “query” : { “match” : { “title” : “search” } }}
![Page 19: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/19.jpg)
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
GET /_search{ “query” : { “match_all” : { } }}
![Page 20: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/20.jpg)
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
GET /_search{ “query” : { “filtered” : { “query” : { … }, “filter” : { … } } }}
![Page 21: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/21.jpg)
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
GET /_search{ “query” : { “filtered” : { “query” : { “match” : { “title” : “search” } }, “filter” : { … } } }}
![Page 22: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/22.jpg)
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
GET /_search{ “query” : { “filtered” : { “query” : { “match” : { “title” : “search” } }, “filter” : { “term” : { “status” : “active” } } } }}
![Page 23: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/23.jpg)
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
GET /_search{ “query” : { “filtered” : { “query” : { “match_all” : { } }, “filter” : { “term” : { “status” : “active” } } } }}
![Page 24: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/24.jpg)
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
GET /_search{ “query” : { “filtered” : { “query” : { “match_all” : { } }, “filter” : { “term” : { “status” : “active” } } } }}
![Page 25: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/25.jpg)
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
How data is indexed ?
![Page 26: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/26.jpg)
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
{ "title": "Quick brown rabbits", "content": "Brown rabbits are commonly seen" }
{ "title": "Keeping pets healthy", "content": "My quick brown fox eats rabbits on a regular basis" }
![Page 27: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/27.jpg)
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
where content like
“%brown%fox%”
![Page 28: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/28.jpg)
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
Analysis
![Page 29: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/29.jpg)
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
{ "title": "Quick brown rabbits", "content": "Brown rabbits are commonly seen" }
{ "title": "Keeping pets healthy", "content": "My quick brown fox eats rabbits on a regular basis" }
![Page 30: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/30.jpg)
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
{ "title": [quick,brown,rabbits], "content": [brown,rabbits,are,commonly,seen] }
{ "title": [keeping,pets,healthy], "content": [my,quick,brown,fox,eats,rabbits,on ,a,regular,basis] }
![Page 31: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/31.jpg)
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
field: content Term Document 1 Document 2
aare
basisbrown
commonlyeatsfoxmyon
quick rabbitsregularseen
![Page 32: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/32.jpg)
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
field: content Term Document 1 Document 2
aare
basisbrown
commonlyeatsfoxmyon
quick rabbitsregularseen
![Page 33: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/33.jpg)
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
Inverted indexed
![Page 34: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/34.jpg)
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
where field = “value”
![Page 35: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/35.jpg)
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
where field contains “value”
![Page 36: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/36.jpg)
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
where field contains “value”term filter
“term” : { “title” : “brown” }
![Page 37: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/37.jpg)
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
GET /_search{ “query” : { “filtered” : { “query” : { “match_all” : { } }, “filter” : { “term” : { “title” : “brown” } } } }}
![Page 38: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/38.jpg)
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
field: title Term Document 1 Document 2
brown
healthy
keeping
pets
quick
rabbits
![Page 39: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/39.jpg)
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
field: title Term Document 1 Document 2
brown
healthy
keeping
pets
quick
rabbits
![Page 40: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/40.jpg)
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
Result
bitset[ 1, 0 ]cache as “title:brown”
![Page 41: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/41.jpg)
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
where field IN [“value1”, … ]
![Page 42: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/42.jpg)
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
terms filter
“terms” : { “title” : [“quick”, “pets”] }
where field IN [“value1”, … ]
![Page 43: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/43.jpg)
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
field: title Term Document 1 Document 2
brown
healthy
keeping
pets
quick
rabbits
![Page 44: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/44.jpg)
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
Result
bitset[ 1, 1 ]cache as “title:quick title:pets”
![Page 45: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/45.jpg)
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
where field >= “value 1” and field < “value 2”
![Page 46: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/46.jpg)
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
where field >= “value 1” and field < “value 2”
range filter
![Page 47: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/47.jpg)
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
“range” : { “content” : { “gte” : “a”, “lt” : “m”
} }
![Page 48: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/48.jpg)
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
field: content Term Document 1 Document 2
aare
basisbrown
commonlyeatsfoxmyon
quick rabbitsregularseen
![Page 49: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/49.jpg)
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
Result
bitset[ 1, 1 ]cache as “content:[a TO m]”
![Page 50: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/50.jpg)
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
AND … OR … NOT
![Page 51: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/51.jpg)
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
AND … OR … NOTbool filter
![Page 52: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/52.jpg)
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
“bool” : { “must” : [ <filters> ], “should” : [ <filters> ], “must_not” : [ <filters> ], }
![Page 53: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/53.jpg)
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
how relevant is this term ?
![Page 54: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/54.jpg)
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
how relevant is this term ?term query
![Page 55: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/55.jpg)
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
GET /_search{ “query” : { “term” : { “title” : “brown” } }}
![Page 56: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/56.jpg)
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
how relevant is this document ?
![Page 57: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/57.jpg)
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
Relevant score
Term in this documentmore is better
![Page 58: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/58.jpg)
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
Relevant score
Term in all documentsless is better
![Page 59: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/59.jpg)
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
Relevant score
How long of this document ?shorter is better
![Page 60: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/60.jpg)
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
AND … OR … NOTbool query
![Page 61: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/61.jpg)
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
“bool” : { “must” : [ <filters> ], #AND “should” : [ <filters> ], ??? “must_not” : [ <filters> ], #NOT }
![Page 62: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/62.jpg)
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
“bool” : { “must” : [ <filters> ], #AND “should” : [ <filters> ], ??? “must_not” : [ <filters> ], #NOT “minimum_should_match” : ? }
![Page 63: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/63.jpg)
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
bool filter -> True | False
bool query -> _score
![Page 64: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/64.jpg)
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
match query
![Page 65: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/65.jpg)
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
match queryhigh level query
understand mapping and analysis
![Page 66: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/66.jpg)
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
match query1. analyze query string2. rewrite query
![Page 67: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/67.jpg)
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
{ “match” : { “title” : “QUICK!” } }
title:quick
{ “term” : { “title” : “quick” } }
![Page 68: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/68.jpg)
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
{ “match” : { “title” : “QUICK FOX!” } }
title:quick OR title:fox
{ “bool” : { “should” : [ { “term” : { “title” : “quick” } }, { “term” : { “title” : “fox” } } ] }}
![Page 69: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/69.jpg)
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
Need all words must match ?
![Page 70: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/70.jpg)
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
GET /_search{ “query” : { “term” : { “title” : “QUICK FOX!” } }}
![Page 71: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/71.jpg)
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
GET /_search{ “query” : { “term” : { “title” : { “query” : “QUICK FOX!”, “operator” : “and” } } }}
![Page 72: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/72.jpg)
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
GET /_search{ "query": {
"bool": { "must": [
{ "term": { "title" : "quick" } }, { "term": { "title" : "fox" } }
] }
} }
![Page 73: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/73.jpg)
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
GET /_search{ “query” : { “match_pharse” : { “title” : { “query” : “QUICK BROWN” } } }}
![Page 74: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/74.jpg)
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
GET /_search{ “query” : { “match_pharse” : { “title” : { “query” : “QUICK RABBITS” } } }}
![Page 75: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/75.jpg)
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
GET /_search{ “query” : { “match_pharse” : { “title” : { “query” : “BROWN QUICK” } } }}
![Page 76: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/76.jpg)
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
Limit long tail ?
![Page 77: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/77.jpg)
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
GET /_search{ “query” : { “term” : { “title” : { “query” : “QUICK BROWN FOX!”, “minimum_should_match” : “75”% } } }}
![Page 78: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/78.jpg)
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
GET /_search{ "query": {
"bool": { "should": [
{ "term": { "title" : "quick" } }, { "term": { "title" : "brown" } }, { "term": { "title" : "fox" } }
], “minimum_should_match” : 2 }
} }
![Page 79: Introduction to elasticsearch fast lane](https://reader034.vdocuments.net/reader034/viewer/2022042522/55d39feabb61eb026b8b466f/html5/thumbnails/79.jpg)
SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
Aggregation APIanalytic your dataexplore your data