SlideShare uma empresa Scribd logo
1 de 62
Baixar para ler offline
Elasticsearch
Tony Messias
MaceioDevMeetup #5
who am I?
➔ Tony Messias ~ @tony0x01
➔ Building web stuff since ~2010
search
what is “search”?
“A search is the organized pursuit of
information (...) that you want to find, but
you have no idea where it is.”
(NASA).
how do we add search to our apps?
➔ SQL queries (not just LIKE queries);
➔ Elasticsearch;
➔ Lucene;
➔ Solr;
➔ …
how do we add search to our apps?
➔ SQL queries (not just LIKE queries);
➔ Elasticsearch;
➔ Lucene;
➔ Solr;
➔ …
who uses it?
what is Elasticsearch?
➔ database server;
➔ document based;
➔ based on Apache Lucene;
➔ schema-free*;
why Elasticsearch?
➔ speaks HTTP/JSON;
➔ easy to setup;
➔ data replication;
➔ easily scalable;
what can I use it for?
but it can do more
than that…
some analogy *
Relational ES
database index
table type
row document
column field
schema mapping
index everything
SQL QueryDSL
REST(ish)
$ curl -XPOST http://es-server.com/index/type/id
-d '{}'
REST(ish)
$ curl -XPOST http://es-server.com/index/type/id
-d '{}'
REST(ish)
$ curl -XPOST http://es-server.com/index/type/id
-d '{}'
REST(ish)
$ curl -XPOST http://es-server.com/index/type/id
-d '{}'
REST(ish)
$ curl -XPOST http://es-server.com/index/type/id
-d '{}'
enough with the
talking… let’s do
some searches!
but first, let’s talk
about CRUD
indexing
{
"email": "john@smith.com",
"first_name": "John",
"last_name": "Smith",
"info": {
"bio": "Eco-warrior and defender of the weak",
"age": 25,
"interests": [ "dolphins", "whales" ]
},
"join_date": "2014/05/01"
}
$ curl -XPOST localhost:9200/my-app/users -d ‘{
"email": "john@smith.com",
"first_name": "John",
"last_name": "Smith",
"info": {
"bio": "Eco-warrior and defender of the weak",
"age": 25,
"interests": [ "dolphins", "whales" ]
},
"join_date": "2014/05/01"
}’
{
"_index": "my-app",
"_type": "users",
"_id": "AUxOBeJbue-jeR3jNcHj",
"_version": 1,
"created": true
}
$ curl -XPUT localhost:9200/my-app/users/AUxOBeJbue-jeR3jNcHj -d
‘{
"email": "john@smith.com",
"first_name": "John"
}’
{
"_index": "my-app",
"_type": "users",
"_id": "AUxOBeJbue-jeR3jNcHj",
"_version": 2,
"created": false
}
$ curl -XGET localhost:9200/my-app/users/AUxOBeJbue-jeR3jNcHj
{
"_index": "my-app",
"_type": "users",
"_id": "AUxOJe-4ue-jeR3jNcHo",
"_version": 2,
"found": true,
"_source": {
"email": "john@smith.com",
"first_name": "John"
}
}
$ curl -XDELETE localhost:9200/my-app/users/AUxOBeJbue-jeR3jNcHj
{
"found": true,
"_index": "my-app",
"_type": "users",
"_id": "AUxOBeJbue-jeR3jNcHj",
"_version": 3
}
searching
$ curl -XPOST localhost:9200/my-app/users/_search -d ‘{
"query": {
"match": {
"first_name": "John"
}
}
}’
{
...,
"hits": {
"total": 4,
"max_score": 0.30685282,
"hits": [
{
"_index": "my-app",
"_type": "users",
"_id": "AUxOJWlCue-jeR3jNcHn",
"_score": 0.30685282,
"_source": {
"email": "john@smith.com",
"first_name": "John",
"last_name": "Doe",
"info": {
"bio": "Like rock music",
"age": 35,
"interests": [
"dolphins",
"whales"
]
},
"join_date": "2014/05/01"
}
},...
$ curl -XPOST localhost:9200/my-app/users/_search -d ‘{
"query": {
"filtered": {
"query": {
"match": {
"first_name": "John"
}
},
"filter": {
"range": {
"info.age": {
"gt": 34
}
}
}
}
}
}’
{
"took": 6,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 1,
"max_score": 0.30685282,
"hits": [
{
"_index": "my-app",
"_type": "users",
"_id": "AUxOJWlCue-jeR3jNcHn",
"_score": 0.30685282,
"_source": {
"email": "john@smith.com",
"first_name": "John",
"last_name": "Doe",
"info": {
"bio": "Like rock music",
"age": 35,
"interests": ["dolphins","whales"]
},
"join_date": "2014/05/01"
}
}
]
}
}
queries vs. filters
queries vs. filters
full-text search
$ curl -XPOST localhost:9200/my-app/users/_search -d ‘{
"query": {
"match": {
"info.bio": "rock climbing"
}
}
}’
{
"took": 9,
"timed_out": false,
"_shards": {...},
"hits": {
"total": 2,
"max_score": 0.2169777,
"hits": [
{
"_index": "my-app",
"_type": "users",
"_id": "AUxOJe-4ue-jeR3jNcHo",
"_score": 0.2169777,
"_source": {
"email": "john@smith.com",
"first_name": "John",
"last_name": "Kennedy",
"info": {
"bio": "I love rock climbing!",
"age": 29,
"interests": ["dolphins","whales"]
},
"join_date": "2014/05/01"
}
},
{
"_index": "my-app",
"_type": "users",
"_id": "AUxOJWlCue-jeR3jNcHn",
"_score": 0.02250402,
"_source": {
"email": "john@smith.com",
"first_name": "John",
"last_name": "Doe",
"info": {
"bio": "Like rock music",
"age": 35,
"interests": ["dolphins","whales"]
},
"join_date": "2014/05/01"
}
}
]
}
}
$ curl -XPOST localhost:9200/my-app/users/_search -d ‘{
"query": {
"match_phrase": {
"info.bio": "rock climbing"
}
}
}’
{…,
"hits": {
"total": 1,
"max_score": 0.30685282,
"hits": [
{
"_index": "my-app",
"_type": "users",
"_id": "AUxOJe-4ue-jeR3jNcHo",
"_score": 0.30685282,
"_source": {
"email": "john@smith.com",
"first_name": "John",
"last_name": "Kennedy",
"info": {
"bio": "I love rock climbing!",
"age": 29,
"interests": ["dolphins","whales"]
},
"join_date": "2014/05/01"
}
}
]
}
}
$ curl -XPOST localhost:9200/my-app/users/_search -d ‘{
"query": {
"match_phrase": {
"info.bio": "rock climbing"
}
},
"highlight": {
"fields": {
"info.bio": {}
}
}
}’
...
{
"_index": "my-app",
"_type": "users",
"_id": "AUxOJe-4ue-jeR3jNcHo",
"_score": 0.30685282,
"_source": {
"email": "john@smith.com",
"first_name": "John",
"last_name": "Kennedy",
"info": {
"bio": "I love rock climbing!",
"age": 29,
"interests": ["dolphins","whales"]
},
"join_date": "2014/05/01"
},
"highlight": {
"info.bio": ["I love <em>rock</em> <em>climbing</em>!"]
}
}
]
}
}
is this it?
analytics
aggregations
buckets metrics
$ curl -XPOST localhost:9200/my-app/users/_search?search_type=count -d'{
"aggs": {
"all_interests": {
"terms": {
"field": "info.interests"
}
}
}
}'
{ ...,
"hits": {"total": 4,"max_score": 0,"hits": []},
"aggregations": {
"all_interests": {
"doc_count_error_upper_bound": 0,
"sum_other_doc_count": 0,
"buckets": [
{
"key": "whales",
"doc_count": 4
},
{
"key": "dolphins",
"doc_count": 3
}
]
}
}}
$ curl -XPOST localhost:9200/my-app/users/_search?search_type=count -d'{
"aggs": {
"all_interests": {
"terms": {
"field": "info.interests"
}
}
}
}'
$ curl -XPOST localhost:9200/my-app/users/_search?search_type=count -d'{
"aggs": {
"all_interests": {
"terms": {
"field": "info.interests"
},
"aggs": {
"avg_age": {
"avg": {
"field": "info.age"
}
}
}
}
}
}'
{
…,
"aggregations": {
"all_interests": {
…,
"buckets": [
{
"key": "whales",
"doc_count": 4,
"avg_age": { "value": 31.5 }
},
{
"key": "dolphins",
"doc_count": 3,
"avg_age": { "value": 32.333333333333336 }
}
]
}}}
$ curl -XPOST localhost:9200/my-app/users/_search?search_type=count -d'{
"query": {
"match_phrase": {
"info.bio": "rock climbing"
}
},
"aggs": {
"all_interests": {
"terms": { "field": "info.interests" },
"aggs": {
"avg_age": {
"avg": { "field": "info.age" }
}
}
}
}}'
{
…,
"aggregations": {
"all_interests": {
…,
"buckets": [
{
"key": "whales",
"doc_count": 1,
"avg_age": {
"value": 29
}
}
]
}}}
questions?
Resources
➔ http://www.elastic.
co/guide/en/elasticsearch/guide/current/index.
html
➔ https://leanpub.com/elasticsearch-quick-start
➔ https://www.elastic.co/use-cases
➔ https://speakerdeck.com/asm89/elasticsearch
Resources
➔ https://speakerdeck.
com/johnbeynon/elasticsearch-101
➔ http://blog.madewithlove.be/post/integrating-
elasticsearch-with-your-laravel-app/
➔ http://blog.madewithlove.be/post/elasticsearch-
aggregations/

Mais conteúdo relacionado

Mais procurados

Data Representation - Day 2
Data Representation - Day 2Data Representation - Day 2
Data Representation - Day 2blprnt
 
Processing & Dataviz
Processing & DatavizProcessing & Dataviz
Processing & Datavizblprnt
 
Building Next-Generation Web APIs with JSON-LD and Hydra
Building Next-Generation Web APIs with JSON-LD and HydraBuilding Next-Generation Web APIs with JSON-LD and Hydra
Building Next-Generation Web APIs with JSON-LD and HydraMarkus Lanthaler
 
Terms of endearment - the ElasticSearch Query DSL explained
Terms of endearment - the ElasticSearch Query DSL explainedTerms of endearment - the ElasticSearch Query DSL explained
Terms of endearment - the ElasticSearch Query DSL explainedclintongormley
 
JSON-LD: JSON for Linked Data
JSON-LD: JSON for Linked DataJSON-LD: JSON for Linked Data
JSON-LD: JSON for Linked DataGregg Kellogg
 
JSON-LD: Linked Data for Web Apps
JSON-LD: Linked Data for Web AppsJSON-LD: Linked Data for Web Apps
JSON-LD: Linked Data for Web AppsGregg Kellogg
 
2014 database - course 3 - PHP and MySQL
2014 database - course 3 - PHP and MySQL2014 database - course 3 - PHP and MySQL
2014 database - course 3 - PHP and MySQLHung-yu Lin
 
MongoDB Europe 2016 - Debugging MongoDB Performance
MongoDB Europe 2016 - Debugging MongoDB PerformanceMongoDB Europe 2016 - Debugging MongoDB Performance
MongoDB Europe 2016 - Debugging MongoDB PerformanceMongoDB
 
JWT - To authentication and beyond!
JWT - To authentication and beyond!JWT - To authentication and beyond!
JWT - To authentication and beyond!Luís Cobucci
 
SF ElasticSearch Meetup - How HipChat Scaled to 1B Messages
SF ElasticSearch Meetup - How HipChat Scaled to 1B MessagesSF ElasticSearch Meetup - How HipChat Scaled to 1B Messages
SF ElasticSearch Meetup - How HipChat Scaled to 1B MessagesAtlassian
 
Coffee, Danish & Search: Presented by Alan Woodward & Charlie Hull, Flax
Coffee, Danish & Search: Presented by Alan Woodward & Charlie Hull, FlaxCoffee, Danish & Search: Presented by Alan Woodward & Charlie Hull, Flax
Coffee, Danish & Search: Presented by Alan Woodward & Charlie Hull, FlaxLucidworks
 
Hydra: A Vocabulary for Hypermedia-Driven Web APIs
Hydra: A Vocabulary for Hypermedia-Driven Web APIsHydra: A Vocabulary for Hypermedia-Driven Web APIs
Hydra: A Vocabulary for Hypermedia-Driven Web APIsMarkus Lanthaler
 
How to win $10m - analysing DOTA2 data in R (Sheffield R Users Group - May)
How to win $10m - analysing DOTA2 data in R (Sheffield R Users Group - May)How to win $10m - analysing DOTA2 data in R (Sheffield R Users Group - May)
How to win $10m - analysing DOTA2 data in R (Sheffield R Users Group - May)Paul Richards
 
Linked Data in Use: Schema.org, JSON-LD and hypermedia APIs - Front in Bahia...
Linked Data in Use: Schema.org, JSON-LD and hypermedia APIs  - Front in Bahia...Linked Data in Use: Schema.org, JSON-LD and hypermedia APIs  - Front in Bahia...
Linked Data in Use: Schema.org, JSON-LD and hypermedia APIs - Front in Bahia...Ícaro Medeiros
 
Building Web Services for Mobile Apps
Building Web Services for Mobile AppsBuilding Web Services for Mobile Apps
Building Web Services for Mobile AppsSepialabs
 
MongoDB and Indexes - MUG Denver - 20160329
MongoDB and Indexes - MUG Denver - 20160329MongoDB and Indexes - MUG Denver - 20160329
MongoDB and Indexes - MUG Denver - 20160329Douglas Duncan
 

Mais procurados (20)

Data Representation - Day 2
Data Representation - Day 2Data Representation - Day 2
Data Representation - Day 2
 
Processing & Dataviz
Processing & DatavizProcessing & Dataviz
Processing & Dataviz
 
Building Next-Generation Web APIs with JSON-LD and Hydra
Building Next-Generation Web APIs with JSON-LD and HydraBuilding Next-Generation Web APIs with JSON-LD and Hydra
Building Next-Generation Web APIs with JSON-LD and Hydra
 
Terms of endearment - the ElasticSearch Query DSL explained
Terms of endearment - the ElasticSearch Query DSL explainedTerms of endearment - the ElasticSearch Query DSL explained
Terms of endearment - the ElasticSearch Query DSL explained
 
Data exchange formats
Data exchange formatsData exchange formats
Data exchange formats
 
JSON-LD: JSON for Linked Data
JSON-LD: JSON for Linked DataJSON-LD: JSON for Linked Data
JSON-LD: JSON for Linked Data
 
JSON-LD: Linked Data for Web Apps
JSON-LD: Linked Data for Web AppsJSON-LD: Linked Data for Web Apps
JSON-LD: Linked Data for Web Apps
 
2014 database - course 3 - PHP and MySQL
2014 database - course 3 - PHP and MySQL2014 database - course 3 - PHP and MySQL
2014 database - course 3 - PHP and MySQL
 
JSON-LD and MongoDB
JSON-LD and MongoDBJSON-LD and MongoDB
JSON-LD and MongoDB
 
Wsomdp
WsomdpWsomdp
Wsomdp
 
MongoDB Europe 2016 - Debugging MongoDB Performance
MongoDB Europe 2016 - Debugging MongoDB PerformanceMongoDB Europe 2016 - Debugging MongoDB Performance
MongoDB Europe 2016 - Debugging MongoDB Performance
 
JWT - To authentication and beyond!
JWT - To authentication and beyond!JWT - To authentication and beyond!
JWT - To authentication and beyond!
 
SF ElasticSearch Meetup - How HipChat Scaled to 1B Messages
SF ElasticSearch Meetup - How HipChat Scaled to 1B MessagesSF ElasticSearch Meetup - How HipChat Scaled to 1B Messages
SF ElasticSearch Meetup - How HipChat Scaled to 1B Messages
 
Coffee, Danish & Search: Presented by Alan Woodward & Charlie Hull, Flax
Coffee, Danish & Search: Presented by Alan Woodward & Charlie Hull, FlaxCoffee, Danish & Search: Presented by Alan Woodward & Charlie Hull, Flax
Coffee, Danish & Search: Presented by Alan Woodward & Charlie Hull, Flax
 
Hydra: A Vocabulary for Hypermedia-Driven Web APIs
Hydra: A Vocabulary for Hypermedia-Driven Web APIsHydra: A Vocabulary for Hypermedia-Driven Web APIs
Hydra: A Vocabulary for Hypermedia-Driven Web APIs
 
How to win $10m - analysing DOTA2 data in R (Sheffield R Users Group - May)
How to win $10m - analysing DOTA2 data in R (Sheffield R Users Group - May)How to win $10m - analysing DOTA2 data in R (Sheffield R Users Group - May)
How to win $10m - analysing DOTA2 data in R (Sheffield R Users Group - May)
 
Linked Data in Use: Schema.org, JSON-LD and hypermedia APIs - Front in Bahia...
Linked Data in Use: Schema.org, JSON-LD and hypermedia APIs  - Front in Bahia...Linked Data in Use: Schema.org, JSON-LD and hypermedia APIs  - Front in Bahia...
Linked Data in Use: Schema.org, JSON-LD and hypermedia APIs - Front in Bahia...
 
Building Web Services for Mobile Apps
Building Web Services for Mobile AppsBuilding Web Services for Mobile Apps
Building Web Services for Mobile Apps
 
3. javascript bangla tutorials
3. javascript bangla tutorials3. javascript bangla tutorials
3. javascript bangla tutorials
 
MongoDB and Indexes - MUG Denver - 20160329
MongoDB and Indexes - MUG Denver - 20160329MongoDB and Indexes - MUG Denver - 20160329
MongoDB and Indexes - MUG Denver - 20160329
 

Destaque

Contrato de arrendamiento
Contrato de arrendamientoContrato de arrendamiento
Contrato de arrendamientoRosmeri Romero
 
Global Hotel Alliance: Campaign Automation on a Global Scale
Global Hotel Alliance: Campaign Automation on a Global ScaleGlobal Hotel Alliance: Campaign Automation on a Global Scale
Global Hotel Alliance: Campaign Automation on a Global ScaleBlueHornet
 
Plan de Competitividad de Turismo Activo. Sierra de Gredos y Valle de Iruelas...
Plan de Competitividad de Turismo Activo. Sierra de Gredos y Valle de Iruelas...Plan de Competitividad de Turismo Activo. Sierra de Gredos y Valle de Iruelas...
Plan de Competitividad de Turismo Activo. Sierra de Gredos y Valle de Iruelas...Turismo de Ávila
 
Alfresco DevCon 2011. Implementing eGov Portal. Powered by Alfresco and Orbeon
Alfresco DevCon 2011. Implementing eGov Portal. Powered by Alfresco and OrbeonAlfresco DevCon 2011. Implementing eGov Portal. Powered by Alfresco and Orbeon
Alfresco DevCon 2011. Implementing eGov Portal. Powered by Alfresco and OrbeonOksana Kurysheva
 
Desarrollo de software seguro: una visión con OpenSAMM
Desarrollo de software seguro: una visión con OpenSAMMDesarrollo de software seguro: una visión con OpenSAMM
Desarrollo de software seguro: una visión con OpenSAMMInternet Security Auditors
 
Company profile twa
Company profile twaCompany profile twa
Company profile twaRatman Bejo
 
El algodón engaña. Nuestro algodón Fox Fibre Cologranic, no.
El algodón engaña. Nuestro algodón Fox Fibre Cologranic, no.El algodón engaña. Nuestro algodón Fox Fibre Cologranic, no.
El algodón engaña. Nuestro algodón Fox Fibre Cologranic, no.FoxFibre Colorganic
 
Codemotion Mad 2014 - Things I love seeing when I buy something online - Brai...
Codemotion Mad 2014 - Things I love seeing when I buy something online - Brai...Codemotion Mad 2014 - Things I love seeing when I buy something online - Brai...
Codemotion Mad 2014 - Things I love seeing when I buy something online - Brai...Alberto López Martín
 
Cyber Security, Why It's important To You
Cyber Security, Why It's important To YouCyber Security, Why It's important To You
Cyber Security, Why It's important To YouRonald E. Laub Jr
 
Newsletter N°14 Mes de Junio
Newsletter N°14 Mes de JunioNewsletter N°14 Mes de Junio
Newsletter N°14 Mes de JunioWest Lubricantes
 
HoneySpider Network: a Java based system to hunt down malicious websites
HoneySpider Network: a Java based system to hunt down malicious websitesHoneySpider Network: a Java based system to hunt down malicious websites
HoneySpider Network: a Java based system to hunt down malicious websitesNLJUG
 
01 orthokeratology children chan
01  orthokeratology children chan01  orthokeratology children chan
01 orthokeratology children chanortokextremadura
 
LatinMarket
LatinMarketLatinMarket
LatinMarketLuis Cam
 

Destaque (20)

Contrato de arrendamiento
Contrato de arrendamientoContrato de arrendamiento
Contrato de arrendamiento
 
Global Hotel Alliance: Campaign Automation on a Global Scale
Global Hotel Alliance: Campaign Automation on a Global ScaleGlobal Hotel Alliance: Campaign Automation on a Global Scale
Global Hotel Alliance: Campaign Automation on a Global Scale
 
Plan de Competitividad de Turismo Activo. Sierra de Gredos y Valle de Iruelas...
Plan de Competitividad de Turismo Activo. Sierra de Gredos y Valle de Iruelas...Plan de Competitividad de Turismo Activo. Sierra de Gredos y Valle de Iruelas...
Plan de Competitividad de Turismo Activo. Sierra de Gredos y Valle de Iruelas...
 
Alfresco DevCon 2011. Implementing eGov Portal. Powered by Alfresco and Orbeon
Alfresco DevCon 2011. Implementing eGov Portal. Powered by Alfresco and OrbeonAlfresco DevCon 2011. Implementing eGov Portal. Powered by Alfresco and Orbeon
Alfresco DevCon 2011. Implementing eGov Portal. Powered by Alfresco and Orbeon
 
Desarrollo de software seguro: una visión con OpenSAMM
Desarrollo de software seguro: una visión con OpenSAMMDesarrollo de software seguro: una visión con OpenSAMM
Desarrollo de software seguro: una visión con OpenSAMM
 
Group office
Group officeGroup office
Group office
 
Fac pubmed
Fac   pubmedFac   pubmed
Fac pubmed
 
Company profile twa
Company profile twaCompany profile twa
Company profile twa
 
El algodón engaña. Nuestro algodón Fox Fibre Cologranic, no.
El algodón engaña. Nuestro algodón Fox Fibre Cologranic, no.El algodón engaña. Nuestro algodón Fox Fibre Cologranic, no.
El algodón engaña. Nuestro algodón Fox Fibre Cologranic, no.
 
Luxury surface
Luxury surfaceLuxury surface
Luxury surface
 
Codemotion Mad 2014 - Things I love seeing when I buy something online - Brai...
Codemotion Mad 2014 - Things I love seeing when I buy something online - Brai...Codemotion Mad 2014 - Things I love seeing when I buy something online - Brai...
Codemotion Mad 2014 - Things I love seeing when I buy something online - Brai...
 
Cyber Security, Why It's important To You
Cyber Security, Why It's important To YouCyber Security, Why It's important To You
Cyber Security, Why It's important To You
 
Newsletter N°14 Mes de Junio
Newsletter N°14 Mes de JunioNewsletter N°14 Mes de Junio
Newsletter N°14 Mes de Junio
 
HoneySpider Network: a Java based system to hunt down malicious websites
HoneySpider Network: a Java based system to hunt down malicious websitesHoneySpider Network: a Java based system to hunt down malicious websites
HoneySpider Network: a Java based system to hunt down malicious websites
 
Version cd web definitiva
Version cd web definitivaVersion cd web definitiva
Version cd web definitiva
 
3. STAY IN Newsletter
3. STAY IN Newsletter3. STAY IN Newsletter
3. STAY IN Newsletter
 
M3 Sistema de rastreo vehicular
M3 Sistema de rastreo vehicularM3 Sistema de rastreo vehicular
M3 Sistema de rastreo vehicular
 
Revista educaccion
Revista educaccionRevista educaccion
Revista educaccion
 
01 orthokeratology children chan
01  orthokeratology children chan01  orthokeratology children chan
01 orthokeratology children chan
 
LatinMarket
LatinMarketLatinMarket
LatinMarket
 

Semelhante a Introduction to Elasticsearch

ElasticSearch in action
ElasticSearch in actionElasticSearch in action
ElasticSearch in actionCodemotion
 
Montreal Elasticsearch Meetup
Montreal Elasticsearch MeetupMontreal Elasticsearch Meetup
Montreal Elasticsearch MeetupLoïc Bertron
 
Introduction to Elasticsearch for Business Intelligence and Application Insights
Introduction to Elasticsearch for Business Intelligence and Application InsightsIntroduction to Elasticsearch for Business Intelligence and Application Insights
Introduction to Elasticsearch for Business Intelligence and Application InsightsData Works MD
 
Elasticsearch - Zero to Hero
Elasticsearch - Zero to HeroElasticsearch - Zero to Hero
Elasticsearch - Zero to HeroDaniel Ziv
 
Elasticmeetup curiosity 20141113
Elasticmeetup curiosity 20141113Elasticmeetup curiosity 20141113
Elasticmeetup curiosity 20141113Erwan Pigneul
 
Curiosity, outil de recherche open source par PagesJaunes
Curiosity, outil de recherche open source par PagesJaunesCuriosity, outil de recherche open source par PagesJaunes
Curiosity, outil de recherche open source par PagesJaunesPagesJaunes
 
Solr vs. Elasticsearch - Case by Case
Solr vs. Elasticsearch - Case by CaseSolr vs. Elasticsearch - Case by Case
Solr vs. Elasticsearch - Case by CaseAlexandre Rafalovitch
 
Full-Text Search Explained - Philipp Krenn - Codemotion Rome 2017
Full-Text Search Explained - Philipp Krenn - Codemotion Rome 2017Full-Text Search Explained - Philipp Krenn - Codemotion Rome 2017
Full-Text Search Explained - Philipp Krenn - Codemotion Rome 2017Codemotion
 
In search of: A meetup about Liferay and Search 2016-04-20
In search of: A meetup about Liferay and Search   2016-04-20In search of: A meetup about Liferay and Search   2016-04-20
In search of: A meetup about Liferay and Search 2016-04-20Tibor Lipusz
 
Test Trend Analysis : Towards robust, reliable and timely tests
Test Trend Analysis : Towards robust, reliable and timely testsTest Trend Analysis : Towards robust, reliable and timely tests
Test Trend Analysis : Towards robust, reliable and timely testsHugh McCamphill
 
Beautiful REST+JSON APIs with Ion
Beautiful REST+JSON APIs with IonBeautiful REST+JSON APIs with Ion
Beautiful REST+JSON APIs with IonStormpath
 
DRUPAL AND ELASTICSEARCH
DRUPAL AND ELASTICSEARCHDRUPAL AND ELASTICSEARCH
DRUPAL AND ELASTICSEARCHDrupalCamp Kyiv
 
How ElasticSearch lives in my DevOps life
How ElasticSearch lives in my DevOps lifeHow ElasticSearch lives in my DevOps life
How ElasticSearch lives in my DevOps life琛琳 饶
 
Elasticsearch: You know, for search! and more!
Elasticsearch: You know, for search! and more!Elasticsearch: You know, for search! and more!
Elasticsearch: You know, for search! and more!Philips Kokoh Prasetyo
 
Scaling Analytics with elasticsearch
Scaling Analytics with elasticsearchScaling Analytics with elasticsearch
Scaling Analytics with elasticsearchdnoble00
 
Data Exploration with Elasticsearch
Data Exploration with ElasticsearchData Exploration with Elasticsearch
Data Exploration with ElasticsearchAleksander Stensby
 
You're not using ElasticSearch (outdated)
You're not using ElasticSearch (outdated)You're not using ElasticSearch (outdated)
You're not using ElasticSearch (outdated)Timon Vonk
 
Talk to me – Chatbots und digitale Assistenten
Talk to me – Chatbots und digitale AssistentenTalk to me – Chatbots und digitale Assistenten
Talk to me – Chatbots und digitale Assistenteninovex GmbH
 
Real-time search in Drupal. Meet Elasticsearch
Real-time search in Drupal. Meet ElasticsearchReal-time search in Drupal. Meet Elasticsearch
Real-time search in Drupal. Meet ElasticsearchAlexei Gorobets
 
SFScon17 - Patrick Puecher: "Exploring data with Elasticsearch and Kibana"
SFScon17 - Patrick Puecher: "Exploring data with Elasticsearch and Kibana"SFScon17 - Patrick Puecher: "Exploring data with Elasticsearch and Kibana"
SFScon17 - Patrick Puecher: "Exploring data with Elasticsearch and Kibana"South Tyrol Free Software Conference
 

Semelhante a Introduction to Elasticsearch (20)

ElasticSearch in action
ElasticSearch in actionElasticSearch in action
ElasticSearch in action
 
Montreal Elasticsearch Meetup
Montreal Elasticsearch MeetupMontreal Elasticsearch Meetup
Montreal Elasticsearch Meetup
 
Introduction to Elasticsearch for Business Intelligence and Application Insights
Introduction to Elasticsearch for Business Intelligence and Application InsightsIntroduction to Elasticsearch for Business Intelligence and Application Insights
Introduction to Elasticsearch for Business Intelligence and Application Insights
 
Elasticsearch - Zero to Hero
Elasticsearch - Zero to HeroElasticsearch - Zero to Hero
Elasticsearch - Zero to Hero
 
Elasticmeetup curiosity 20141113
Elasticmeetup curiosity 20141113Elasticmeetup curiosity 20141113
Elasticmeetup curiosity 20141113
 
Curiosity, outil de recherche open source par PagesJaunes
Curiosity, outil de recherche open source par PagesJaunesCuriosity, outil de recherche open source par PagesJaunes
Curiosity, outil de recherche open source par PagesJaunes
 
Solr vs. Elasticsearch - Case by Case
Solr vs. Elasticsearch - Case by CaseSolr vs. Elasticsearch - Case by Case
Solr vs. Elasticsearch - Case by Case
 
Full-Text Search Explained - Philipp Krenn - Codemotion Rome 2017
Full-Text Search Explained - Philipp Krenn - Codemotion Rome 2017Full-Text Search Explained - Philipp Krenn - Codemotion Rome 2017
Full-Text Search Explained - Philipp Krenn - Codemotion Rome 2017
 
In search of: A meetup about Liferay and Search 2016-04-20
In search of: A meetup about Liferay and Search   2016-04-20In search of: A meetup about Liferay and Search   2016-04-20
In search of: A meetup about Liferay and Search 2016-04-20
 
Test Trend Analysis : Towards robust, reliable and timely tests
Test Trend Analysis : Towards robust, reliable and timely testsTest Trend Analysis : Towards robust, reliable and timely tests
Test Trend Analysis : Towards robust, reliable and timely tests
 
Beautiful REST+JSON APIs with Ion
Beautiful REST+JSON APIs with IonBeautiful REST+JSON APIs with Ion
Beautiful REST+JSON APIs with Ion
 
DRUPAL AND ELASTICSEARCH
DRUPAL AND ELASTICSEARCHDRUPAL AND ELASTICSEARCH
DRUPAL AND ELASTICSEARCH
 
How ElasticSearch lives in my DevOps life
How ElasticSearch lives in my DevOps lifeHow ElasticSearch lives in my DevOps life
How ElasticSearch lives in my DevOps life
 
Elasticsearch: You know, for search! and more!
Elasticsearch: You know, for search! and more!Elasticsearch: You know, for search! and more!
Elasticsearch: You know, for search! and more!
 
Scaling Analytics with elasticsearch
Scaling Analytics with elasticsearchScaling Analytics with elasticsearch
Scaling Analytics with elasticsearch
 
Data Exploration with Elasticsearch
Data Exploration with ElasticsearchData Exploration with Elasticsearch
Data Exploration with Elasticsearch
 
You're not using ElasticSearch (outdated)
You're not using ElasticSearch (outdated)You're not using ElasticSearch (outdated)
You're not using ElasticSearch (outdated)
 
Talk to me – Chatbots und digitale Assistenten
Talk to me – Chatbots und digitale AssistentenTalk to me – Chatbots und digitale Assistenten
Talk to me – Chatbots und digitale Assistenten
 
Real-time search in Drupal. Meet Elasticsearch
Real-time search in Drupal. Meet ElasticsearchReal-time search in Drupal. Meet Elasticsearch
Real-time search in Drupal. Meet Elasticsearch
 
SFScon17 - Patrick Puecher: "Exploring data with Elasticsearch and Kibana"
SFScon17 - Patrick Puecher: "Exploring data with Elasticsearch and Kibana"SFScon17 - Patrick Puecher: "Exploring data with Elasticsearch and Kibana"
SFScon17 - Patrick Puecher: "Exploring data with Elasticsearch and Kibana"
 

Mais de Luiz Messias

Phoenix for laravel developers
Phoenix for laravel developersPhoenix for laravel developers
Phoenix for laravel developersLuiz Messias
 
Queues & Async Apps
 Queues & Async Apps Queues & Async Apps
Queues & Async AppsLuiz Messias
 
Laravel's ecosystem
Laravel's ecosystemLaravel's ecosystem
Laravel's ecosystemLuiz Messias
 
Command-Oriented Architecture
Command-Oriented ArchitectureCommand-Oriented Architecture
Command-Oriented ArchitectureLuiz Messias
 
APIs seguras com OAuth2
APIs seguras com OAuth2APIs seguras com OAuth2
APIs seguras com OAuth2Luiz Messias
 
Google App Engine e PHP
Google App Engine e PHPGoogle App Engine e PHP
Google App Engine e PHPLuiz Messias
 

Mais de Luiz Messias (7)

Phoenix for laravel developers
Phoenix for laravel developersPhoenix for laravel developers
Phoenix for laravel developers
 
Turbolinks
TurbolinksTurbolinks
Turbolinks
 
Queues & Async Apps
 Queues & Async Apps Queues & Async Apps
Queues & Async Apps
 
Laravel's ecosystem
Laravel's ecosystemLaravel's ecosystem
Laravel's ecosystem
 
Command-Oriented Architecture
Command-Oriented ArchitectureCommand-Oriented Architecture
Command-Oriented Architecture
 
APIs seguras com OAuth2
APIs seguras com OAuth2APIs seguras com OAuth2
APIs seguras com OAuth2
 
Google App Engine e PHP
Google App Engine e PHPGoogle App Engine e PHP
Google App Engine e PHP
 

Último

+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
Pharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodologyPharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodologyAnusha Are
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...SelfMade bd
 
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456KiaraTiradoMicha
 
ManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide DeckManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide DeckManageIQ
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfayushiqss
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfonteinmasabamasaba
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnAmarnathKambale
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdfPearlKirahMaeRagusta1
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is insideshinachiaurasa2
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfkalichargn70th171
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrainmasabamasaba
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesVictorSzoltysek
 

Último (20)

+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Pharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodologyPharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodology
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456
 
ManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide DeckManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide Deck
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 

Introduction to Elasticsearch

  • 2. who am I? ➔ Tony Messias ~ @tony0x01 ➔ Building web stuff since ~2010
  • 3.
  • 5. what is “search”? “A search is the organized pursuit of information (...) that you want to find, but you have no idea where it is.” (NASA).
  • 6. how do we add search to our apps? ➔ SQL queries (not just LIKE queries); ➔ Elasticsearch; ➔ Lucene; ➔ Solr; ➔ …
  • 7. how do we add search to our apps? ➔ SQL queries (not just LIKE queries); ➔ Elasticsearch; ➔ Lucene; ➔ Solr; ➔ …
  • 9.
  • 10. what is Elasticsearch? ➔ database server; ➔ document based; ➔ based on Apache Lucene; ➔ schema-free*;
  • 11. why Elasticsearch? ➔ speaks HTTP/JSON; ➔ easy to setup; ➔ data replication; ➔ easily scalable;
  • 12. what can I use it for?
  • 13.
  • 14. but it can do more than that…
  • 15. some analogy * Relational ES database index table type row document column field schema mapping index everything SQL QueryDSL
  • 16. REST(ish) $ curl -XPOST http://es-server.com/index/type/id -d '{}'
  • 17. REST(ish) $ curl -XPOST http://es-server.com/index/type/id -d '{}'
  • 18. REST(ish) $ curl -XPOST http://es-server.com/index/type/id -d '{}'
  • 19. REST(ish) $ curl -XPOST http://es-server.com/index/type/id -d '{}'
  • 20. REST(ish) $ curl -XPOST http://es-server.com/index/type/id -d '{}'
  • 21. enough with the talking… let’s do some searches!
  • 22. but first, let’s talk about CRUD
  • 23.
  • 25. { "email": "john@smith.com", "first_name": "John", "last_name": "Smith", "info": { "bio": "Eco-warrior and defender of the weak", "age": 25, "interests": [ "dolphins", "whales" ] }, "join_date": "2014/05/01" }
  • 26. $ curl -XPOST localhost:9200/my-app/users -d ‘{ "email": "john@smith.com", "first_name": "John", "last_name": "Smith", "info": { "bio": "Eco-warrior and defender of the weak", "age": 25, "interests": [ "dolphins", "whales" ] }, "join_date": "2014/05/01" }’
  • 27. { "_index": "my-app", "_type": "users", "_id": "AUxOBeJbue-jeR3jNcHj", "_version": 1, "created": true }
  • 28. $ curl -XPUT localhost:9200/my-app/users/AUxOBeJbue-jeR3jNcHj -d ‘{ "email": "john@smith.com", "first_name": "John" }’
  • 29. { "_index": "my-app", "_type": "users", "_id": "AUxOBeJbue-jeR3jNcHj", "_version": 2, "created": false }
  • 30. $ curl -XGET localhost:9200/my-app/users/AUxOBeJbue-jeR3jNcHj { "_index": "my-app", "_type": "users", "_id": "AUxOJe-4ue-jeR3jNcHo", "_version": 2, "found": true, "_source": { "email": "john@smith.com", "first_name": "John" } }
  • 31. $ curl -XDELETE localhost:9200/my-app/users/AUxOBeJbue-jeR3jNcHj { "found": true, "_index": "my-app", "_type": "users", "_id": "AUxOBeJbue-jeR3jNcHj", "_version": 3 }
  • 33. $ curl -XPOST localhost:9200/my-app/users/_search -d ‘{ "query": { "match": { "first_name": "John" } } }’
  • 34. { ..., "hits": { "total": 4, "max_score": 0.30685282, "hits": [ { "_index": "my-app", "_type": "users", "_id": "AUxOJWlCue-jeR3jNcHn", "_score": 0.30685282, "_source": { "email": "john@smith.com", "first_name": "John", "last_name": "Doe", "info": { "bio": "Like rock music", "age": 35, "interests": [ "dolphins", "whales" ] }, "join_date": "2014/05/01" } },...
  • 35. $ curl -XPOST localhost:9200/my-app/users/_search -d ‘{ "query": { "filtered": { "query": { "match": { "first_name": "John" } }, "filter": { "range": { "info.age": { "gt": 34 } } } } } }’
  • 36. { "took": 6, "timed_out": false, "_shards": { "total": 5, "successful": 5, "failed": 0 }, "hits": { "total": 1, "max_score": 0.30685282, "hits": [ { "_index": "my-app", "_type": "users", "_id": "AUxOJWlCue-jeR3jNcHn", "_score": 0.30685282, "_source": { "email": "john@smith.com", "first_name": "John", "last_name": "Doe", "info": { "bio": "Like rock music", "age": 35, "interests": ["dolphins","whales"] }, "join_date": "2014/05/01" } } ] } }
  • 40. $ curl -XPOST localhost:9200/my-app/users/_search -d ‘{ "query": { "match": { "info.bio": "rock climbing" } } }’
  • 41. { "took": 9, "timed_out": false, "_shards": {...}, "hits": { "total": 2, "max_score": 0.2169777, "hits": [ { "_index": "my-app", "_type": "users", "_id": "AUxOJe-4ue-jeR3jNcHo", "_score": 0.2169777, "_source": { "email": "john@smith.com", "first_name": "John", "last_name": "Kennedy", "info": { "bio": "I love rock climbing!", "age": 29, "interests": ["dolphins","whales"] }, "join_date": "2014/05/01" } }, { "_index": "my-app", "_type": "users", "_id": "AUxOJWlCue-jeR3jNcHn", "_score": 0.02250402, "_source": { "email": "john@smith.com", "first_name": "John", "last_name": "Doe", "info": { "bio": "Like rock music", "age": 35, "interests": ["dolphins","whales"] }, "join_date": "2014/05/01" } } ] } }
  • 42. $ curl -XPOST localhost:9200/my-app/users/_search -d ‘{ "query": { "match_phrase": { "info.bio": "rock climbing" } } }’
  • 43. {…, "hits": { "total": 1, "max_score": 0.30685282, "hits": [ { "_index": "my-app", "_type": "users", "_id": "AUxOJe-4ue-jeR3jNcHo", "_score": 0.30685282, "_source": { "email": "john@smith.com", "first_name": "John", "last_name": "Kennedy", "info": { "bio": "I love rock climbing!", "age": 29, "interests": ["dolphins","whales"] }, "join_date": "2014/05/01" } } ] } }
  • 44. $ curl -XPOST localhost:9200/my-app/users/_search -d ‘{ "query": { "match_phrase": { "info.bio": "rock climbing" } }, "highlight": { "fields": { "info.bio": {} } } }’
  • 45. ... { "_index": "my-app", "_type": "users", "_id": "AUxOJe-4ue-jeR3jNcHo", "_score": 0.30685282, "_source": { "email": "john@smith.com", "first_name": "John", "last_name": "Kennedy", "info": { "bio": "I love rock climbing!", "age": 29, "interests": ["dolphins","whales"] }, "join_date": "2014/05/01" }, "highlight": { "info.bio": ["I love <em>rock</em> <em>climbing</em>!"] } } ] } }
  • 47.
  • 48.
  • 52. $ curl -XPOST localhost:9200/my-app/users/_search?search_type=count -d'{ "aggs": { "all_interests": { "terms": { "field": "info.interests" } } } }'
  • 53. { ..., "hits": {"total": 4,"max_score": 0,"hits": []}, "aggregations": { "all_interests": { "doc_count_error_upper_bound": 0, "sum_other_doc_count": 0, "buckets": [ { "key": "whales", "doc_count": 4 }, { "key": "dolphins", "doc_count": 3 } ] } }}
  • 54. $ curl -XPOST localhost:9200/my-app/users/_search?search_type=count -d'{ "aggs": { "all_interests": { "terms": { "field": "info.interests" } } } }'
  • 55. $ curl -XPOST localhost:9200/my-app/users/_search?search_type=count -d'{ "aggs": { "all_interests": { "terms": { "field": "info.interests" }, "aggs": { "avg_age": { "avg": { "field": "info.age" } } } } } }'
  • 56. { …, "aggregations": { "all_interests": { …, "buckets": [ { "key": "whales", "doc_count": 4, "avg_age": { "value": 31.5 } }, { "key": "dolphins", "doc_count": 3, "avg_age": { "value": 32.333333333333336 } } ] }}}
  • 57. $ curl -XPOST localhost:9200/my-app/users/_search?search_type=count -d'{ "query": { "match_phrase": { "info.bio": "rock climbing" } }, "aggs": { "all_interests": { "terms": { "field": "info.interests" }, "aggs": { "avg_age": { "avg": { "field": "info.age" } } } } }}'
  • 58. { …, "aggregations": { "all_interests": { …, "buckets": [ { "key": "whales", "doc_count": 1, "avg_age": { "value": 29 } } ] }}}
  • 59.