SlideShare une entreprise Scribd logo
1  sur  44
David Pilato
@dadoonet
elasticsearch
in 15 minutes
mercredi 3 juillet 13
Elasticsearch.com
• Créée en 2012 par les auteurs
d’Elasticsearch
• Formation (publique et intra)
• Consulting (support dév)
• Abonnement annuel support pour
la production avec 3 niveaux de
SLA
mercredi 3 juillet 13
Plug & Play
mercredi 3 juillet 13
Installation
$ wget https://download.elasticsearch.org/...
$ tar -xf elasticsearch-0.90.2.tar.gz
$ ./elasticsearch-0.90.2/bin/elasticsearch -f
... [INFO ][node][Ghost Maker] {0.90.2}[5645]: initializing ...
mercredi 3 juillet 13
Index a document...
$ curl -XPUT localhost:9200/products/product/1 -d '{
"title" : "Welcome!"
}'
mercredi 3 juillet 13
Update a document...
$ curl -XPUT localhost:9200/products/product/1 -d '{
"title" : "Welcome to the Elasticsearch meetup!"
}'
mercredi 3 juillet 13
{
"id" : "abc123",
"title" : "A JSON Document",
"body" : "A JSON document is a ...",
"published_on" : "2013/06/27 10:00:00",
"featured" : true,
"tags" : ["search", "json"],
"author" : {
"first_name" : "Clara",
"last_name" : "Rice",
"email" : "clara@rice.org"
}
}
Documents as JSON
Data structure with basic types, arrays and deep hierarchies
mercredi 3 juillet 13
Search for documents....
$ curl localhost:9200/products/_search?q=welcome
mercredi 3 juillet 13
Add a node...
$ ./elasticsearch-0.90.2/bin/elasticsearch -f -D es.node.name=Node2
...[cluster.service] [Node2] detected_master [Node1] ...
mercredi 3 juillet 13
Add a node...
$ ./elasticsearch-0.90.2/bin/elasticsearch -f -D es.node.name=Node2
...[cluster.service] [Node2] detected_master [Node1] ...
mercredi 3 juillet 13
Add another node...
$ ./elasticsearch-0.90.2/bin/elasticsearch -f -D es.node.name=Node3
...[cluster.service] [Node3] detected_master [Node1] ...
mercredi 3 juillet 13
Add another node...
$ ./elasticsearch-0.90.2/bin/elasticsearch -f -D es.node.name=Node3
...[cluster.service] [Node3] detected_master [Node1] ...
mercredi 3 juillet 13
Add another node...
$ ./elasticsearch-0.90.2/bin/elasticsearch -f -D es.node.name=Node3
...[cluster.service] [Node3] detected_master [Node1] ...
"index.routing.allocation.exclude.name" : "Node1"
"cluster.routing.allocation.exclude.name" : "Node3"
mercredi 3 juillet 13
mercredi 3 juillet 13
Until you know what to tweak...
mercredi 3 juillet 13
Search & Find
mercredi 3 juillet 13
Terms
apple
apple iphone
Phrases "apple iphone"
Proximity "apple safari"~5
Fuzzy apple~0.8
Wildcards
app*
*pp*
Boosting apple^10 safari
Range
[2011/05/01 TO 2011/05/31]
[java TO json]
Boolean
apple AND NOT iphone
+apple -iphone
(apple OR iphone) AND NOT review
Fields
title:iphone^15 OR body:iphone
published_on:[2011/05/01 TO "2011/05/27 10:00:00"]
http://lucene.apache.org/java/3_1_0/queryparsersyntax.html
$ curl -XGET "http://localhost:9200/_search?q=<YOUR QUERY>"
mercredi 3 juillet 13
JSON-based Query DSL
curl -XGET localhost:9200/articles/_search -d '{
"query" : {
"filtered" : {
"query" : {
"bool" : {
"must" : {
"match" : {
"author.first_name" : {
"query" : "claire",
"fuzziness" : 0.1
}
}
},
"must" : {
"multi_match" : {
"query" : "elasticsearch",
"fields" : ["title^10", "body"]
}
}
}
},
"filter": {
"and" : [
{ "terms" : { "tags" : ["search"] } },
{ "range" : { "published_on": {"from": "2013"} } },
{ "term" : { "featured" : true } }
]
}
}
}
}'
mercredi 3 juillet 13
JSON-based Query DSL
curl -XGET localhost:9200/articles/_search -d '{
"query" : {
"filtered" : {
"query" : {
"bool" : {
"must" : {
"match" : {
"author.first_name" : {
"query" : "claire",
"fuzziness" : 0.1
}
}
},
"must" : {
"multi_match" : {
"query" : "elasticsearch",
"fields" : ["title^10", "body"]
}
}
}
},
"filter": {
"and" : [
{ "terms" : { "tags" : ["search"] } },
{ "range" : { "published_on": {"from": "2013"} } },
{ "term" : { "featured" : true } }
]
}
}
}
}'
mercredi 3 juillet 13
curl -XGET localhost:9200/articles/_search -d '{
"query" : {
"filtered" : {
"query" : {
"bool" : {
"must" : {
"match" : {
"author.first_name" : {
"query" : "claire",
"fuzziness" : 0.1
}
}
},
"must" : {
"multi_match" : {
"query" : "elasticsearch",
"fields" : ["title^10", "body"]
}
}
}
},
"filter": {
"and" : [
{ "terms" : { "tags" : ["search"] } },
{ "range" : { "published_on": {"from": "2013"} } },
{ "term" : { "featured" : true } }
]
}
}
}
}'
JSON-based Query DSL
mercredi 3 juillet 13
JSON-based Query DSL
curl -XGET localhost:9200/articles/_search -d '{
"query" : {
"filtered" : {
"query" : {
"bool" : {
"must" : {
"match" : {
"author.first_name" : {
"query" : "claire",
"fuzziness" : 0.1
}
}
},
"must" : {
"multi_match" : {
"query" : "elasticsearch",
"fields" : ["title^10", "body"]
}
}
}
},
"filter": {
"and" : [
{ "terms" : { "tags" : ["search"] } },
{ "range" : { "published_on": {"from": "2013"} } },
{ "term" : { "featured" : true } }
]
}
}
}
}'
mercredi 3 juillet 13
JSON-based Query DSL
curl -XGET localhost:9200/articles/_search -d '{
"query" : {
"filtered" : {
"query" : {
"bool" : {
"must" : {
"match" : {
"author.first_name" : {
"query" : "claire",
"fuzziness" : 0.1
}
}
},
"must" : {
"multi_match" : {
"query" : "elasticsearch",
"fields" : ["title^10", "body"]
}
}
}
},
"filter": {
"and" : [
{ "terms" : { "tags" : ["search"] } },
{ "range" : { "published_on": {"from": "2013"} } },
{ "term" : { "featured" : true } }
]
}
}
}
}'
mercredi 3 juillet 13
“Find all articles with ‘search’ in their title or body, give
matches in titles higher score”
Full-text Search
“Find all articles from year 2013 tagged ‘search’”
Structured Search
See custom_score and custom_filters_score queries
Custom Scoring
“Find all articles with ‘search’ in their title or body, give
matches in titles higher score and filter articles from year 2013
tagged ‘search’ “
Combined Search
mercredi 3 juillet 13
What is really a search engine?
mercredi 3 juillet 13
What is really a search engine?
mercredi 3 juillet 13
Fetch document field ➝ Pick configured analyzer ➝ Parse
text into tokens ➝ Apply token filters ➝ Store into index
What is really a search engine?
mercredi 3 juillet 13
The _analyze API
_analyze?text=...&tokenizer=X&filters=A,B,C
mercredi 3 juillet 13
curl 'localhost:9200/_analyze?pretty&tokenizer=keyword&filters=lowercase' 
-d 'This is a Test'
The _analyze API
_analyze?text=...&tokenizer=X&filters=A,B,C
mercredi 3 juillet 13
curl 'localhost:9200/_analyze?pretty&tokenizer=keyword&filters=lowercase' 
-d 'This is a Test'
The _analyze API
{
"tokens" : [ {
"token" : "this is a test",
"start_offset" : 0, "end_offset" : 14,
"type" : "word", "position" : 1
} ]
}
_analyze?text=...&tokenizer=X&filters=A,B,C
mercredi 3 juillet 13
curl 'localhost:9200/_analyze?pretty&tokenizer=keyword&filters=lowercase' 
-d 'This is a Test'
The _analyze API
{
"tokens" : [ {
"token" : "this is a test",
"start_offset" : 0, "end_offset" : 14,
"type" : "word", "position" : 1
} ]
}
_analyze?text=...&tokenizer=X&filters=A,B,C
curl 'localhost:9200/_analyze?pretty&analyzer=standard' -d 'This is a Test'
mercredi 3 juillet 13
curl 'localhost:9200/_analyze?pretty&tokenizer=keyword&filters=lowercase' 
-d 'This is a Test'
The _analyze API
{
"tokens" : [ {
"token" : "this is a test",
"start_offset" : 0, "end_offset" : 14,
"type" : "word", "position" : 1
} ]
}
_analyze?text=...&tokenizer=X&filters=A,B,C
curl 'localhost:9200/_analyze?pretty&analyzer=standard' -d 'This is a Test'
{
"tokens" : [ {
"token" : "test",
"start_offset" : 10, "end_offset" : 14,
"type" : "<ALPHANUM>", "position" : 4
} ]
}
mercredi 3 juillet 13
Mapping
curl -XPUT localhost:9200/articles/_mapping -d '{
"article" : {
"properties" : {
"title" : {
"type" : "string",
"analyzer" : "french"
}
}
}
}'
Configuring document properties for the search engine
mercredi 3 juillet 13
Slice & Dice
mercredi 3 juillet 13
Query
Facets
mercredi 3 juillet 13
Location
Product
Tim
e
OLAP Cube
Dimensions, measures, aggregations
mercredi 3 juillet 13
Slice Dice Drill Down / Roll Up
Show me sales numbers for all products across all locations in year 2013
Show me product A sales numbers across all locations over all years
Show me products sales numbers in location X over all years
mercredi 3 juillet 13
curl -XPOST 'localhost:9200/articles/_search?search_type=count&pretty' -d '{
"facets": {
"tag-cloug": {
"terms" : {
"field" : "tags"
}
}
}
}'
“Tag Cloud” With the terms Facet
"facets" : {
"tag-cloug" : {
"terms" : [ {
"term" : "ruby",
"count" : 3
}, {
"term" : "java",
"count" : 2
},
...
} ]
}
}
Simplest “map/reduce” aggregation: document count per tag
mercredi 3 juillet 13
curl -XGET 'localhost:9200/scores/_search/?search_type=count&pretty' -d '{
"facets": {
"scores-per-subject" : {
"terms_stats" : {
"key_field" : "subject",
"value_field" : "score"
}
}
}
}'
Statistics on Student Scores With the terms_stats Facet
"facets" : {
"scores-per-subject" : {
"_type" : "terms_stats",
"missing" : 0,
"terms" : [ {
"term" : "math",
"count" : 4,
"total_count" : 4,
"min" : 25.0,
"max" : 92.0,
"total" : 267.0,
"mean" : 66.75
}, ... ]
}
}
Aggregating statistics per subject
mercredi 3 juillet 13
curl -X GET 'localhost:9200/demo-scores/_search/?search_type=count&pretty'
'{
"query" : {
"match" : {
"student" : "john"
}
},
"facets": {
"scores-per-subject" : {
"terms_stats" : {
"key_field" : "subject",
"value_field" : "score"
}
}
}
}'
Statistics on Student Scores With the terms_stats Facet
"facets" : {
"scores-per-subject" : {
"_type" : "terms_stats",
"missing" : 0,
"terms" : [ {
"term" : "math",
"count" : 1,
"total_count" : 1,
"min" : 85.0,
"max" : 85.0,
"total" : 85.0,
"mean" : 85.0
}, ... ]
}
}
Realtime filtering with queries and filters
mercredi 3 juillet 13
Facets
Terms
Terms Stats
Statistical
Range
Histogram
Date Histogram
Filter
Query
Geo Distance
mercredi 3 juillet 13
Above
& 
Beyond
mercredi 3 juillet 13
Above & Beyond
Bulk operations (For indexing and search operations)
Percolator (“reversed search” — alerts, classification, …)
Suggesters (“Did you mean …?”)
Index aliases (Grouping, filtering or “renaming” of indices)
Index templates (Automatic index configuration)
Monitoring API (Amount of memory used, number of operations, …)
…
mercredi 3 juillet 13
Above & Beyond
Bulk operations (For indexing and search operations)
Percolator (“reversed search” — alerts, classification, …)
Suggesters (“Did you mean …?”)
Index aliases (Grouping, filtering or “renaming” of indices)
Index templates (Automatic index configuration)
Monitoring API (Amount of memory used, number of operations, …)
…
GUI?
Give Kibana a try
http://three.kibana.org/
mercredi 3 juillet 13
thanks!
David Pilato
@dadoonet
mercredi 3 juillet 13

Contenu connexe

Tendances

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
 
ElasticSearch in action
ElasticSearch in actionElasticSearch in action
ElasticSearch in actionCodemotion
 
Solr vs. Elasticsearch - Case by Case
Solr vs. Elasticsearch - Case by CaseSolr vs. Elasticsearch - Case by Case
Solr vs. Elasticsearch - Case by CaseAlexandre Rafalovitch
 
Cool bonsai cool - an introduction to ElasticSearch
Cool bonsai cool - an introduction to ElasticSearchCool bonsai cool - an introduction to ElasticSearch
Cool bonsai cool - an introduction to ElasticSearchclintongormley
 
Introduction to Elasticsearch with basics of Lucene
Introduction to Elasticsearch with basics of LuceneIntroduction to Elasticsearch with basics of Lucene
Introduction to Elasticsearch with basics of LuceneRahul Jain
 
Query DSL In Elasticsearch
Query DSL In ElasticsearchQuery DSL In Elasticsearch
Query DSL In ElasticsearchKnoldus Inc.
 
ElasticSearch - DevNexus Atlanta - 2014
ElasticSearch - DevNexus Atlanta - 2014ElasticSearch - DevNexus Atlanta - 2014
ElasticSearch - DevNexus Atlanta - 2014Roy Russo
 
Intro to Elasticsearch
Intro to ElasticsearchIntro to Elasticsearch
Intro to ElasticsearchClifford James
 
Managing Your Content with Elasticsearch
Managing Your Content with ElasticsearchManaging Your Content with Elasticsearch
Managing Your Content with ElasticsearchSamantha Quiñones
 
Elasticsearch for Data Analytics
Elasticsearch for Data AnalyticsElasticsearch for Data Analytics
Elasticsearch for Data AnalyticsFelipe
 
Elastic search apache_solr
Elastic search apache_solrElastic search apache_solr
Elastic search apache_solrmacrochen
 
Elastic search overview
Elastic search overviewElastic search overview
Elastic search overviewABC Talks
 
ElasticSearch for .NET Developers
ElasticSearch for .NET DevelopersElasticSearch for .NET Developers
ElasticSearch for .NET DevelopersBen van Mol
 
Philly PHP: April '17 Elastic Search Introduction by Aditya Bhamidpati
Philly PHP: April '17 Elastic Search Introduction by Aditya BhamidpatiPhilly PHP: April '17 Elastic Search Introduction by Aditya Bhamidpati
Philly PHP: April '17 Elastic Search Introduction by Aditya BhamidpatiRobert Calcavecchia
 
What I learnt: Elastic search & Kibana : introduction, installtion & configur...
What I learnt: Elastic search & Kibana : introduction, installtion & configur...What I learnt: Elastic search & Kibana : introduction, installtion & configur...
What I learnt: Elastic search & Kibana : introduction, installtion & configur...Rahul K Chauhan
 
Elastic Search
Elastic SearchElastic Search
Elastic SearchNavule Rao
 
Intro to elasticsearch
Intro to elasticsearchIntro to elasticsearch
Intro to elasticsearchJoey Wen
 

Tendances (20)

Elasticsearch Introduction at BigData meetup
Elasticsearch Introduction at BigData meetupElasticsearch Introduction at BigData meetup
Elasticsearch Introduction at BigData meetup
 
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!
 
ElasticSearch in action
ElasticSearch in actionElasticSearch in action
ElasticSearch in action
 
Solr vs. Elasticsearch - Case by Case
Solr vs. Elasticsearch - Case by CaseSolr vs. Elasticsearch - Case by Case
Solr vs. Elasticsearch - Case by Case
 
Cool bonsai cool - an introduction to ElasticSearch
Cool bonsai cool - an introduction to ElasticSearchCool bonsai cool - an introduction to ElasticSearch
Cool bonsai cool - an introduction to ElasticSearch
 
Elasticsearch
ElasticsearchElasticsearch
Elasticsearch
 
Introduction to Elasticsearch with basics of Lucene
Introduction to Elasticsearch with basics of LuceneIntroduction to Elasticsearch with basics of Lucene
Introduction to Elasticsearch with basics of Lucene
 
Query DSL In Elasticsearch
Query DSL In ElasticsearchQuery DSL In Elasticsearch
Query DSL In Elasticsearch
 
ElasticSearch - DevNexus Atlanta - 2014
ElasticSearch - DevNexus Atlanta - 2014ElasticSearch - DevNexus Atlanta - 2014
ElasticSearch - DevNexus Atlanta - 2014
 
Intro to Elasticsearch
Intro to ElasticsearchIntro to Elasticsearch
Intro to Elasticsearch
 
Managing Your Content with Elasticsearch
Managing Your Content with ElasticsearchManaging Your Content with Elasticsearch
Managing Your Content with Elasticsearch
 
Elasticsearch for Data Analytics
Elasticsearch for Data AnalyticsElasticsearch for Data Analytics
Elasticsearch for Data Analytics
 
Elastic search apache_solr
Elastic search apache_solrElastic search apache_solr
Elastic search apache_solr
 
Elastic search overview
Elastic search overviewElastic search overview
Elastic search overview
 
Elasticsearch Introduction
Elasticsearch IntroductionElasticsearch Introduction
Elasticsearch Introduction
 
ElasticSearch for .NET Developers
ElasticSearch for .NET DevelopersElasticSearch for .NET Developers
ElasticSearch for .NET Developers
 
Philly PHP: April '17 Elastic Search Introduction by Aditya Bhamidpati
Philly PHP: April '17 Elastic Search Introduction by Aditya BhamidpatiPhilly PHP: April '17 Elastic Search Introduction by Aditya Bhamidpati
Philly PHP: April '17 Elastic Search Introduction by Aditya Bhamidpati
 
What I learnt: Elastic search & Kibana : introduction, installtion & configur...
What I learnt: Elastic search & Kibana : introduction, installtion & configur...What I learnt: Elastic search & Kibana : introduction, installtion & configur...
What I learnt: Elastic search & Kibana : introduction, installtion & configur...
 
Elastic Search
Elastic SearchElastic Search
Elastic Search
 
Intro to elasticsearch
Intro to elasticsearchIntro to elasticsearch
Intro to elasticsearch
 

Similaire à Elasticsearch in 15 minutes

Elasticsearch in 15 Minutes
Elasticsearch in 15 MinutesElasticsearch in 15 Minutes
Elasticsearch in 15 MinutesKarel Minarik
 
elasticsearch basics workshop
elasticsearch basics workshopelasticsearch basics workshop
elasticsearch basics workshopMathieu Elie
 
Elasticsearch – mye mer enn søk! [JavaZone 2013]
Elasticsearch – mye mer enn søk! [JavaZone 2013]Elasticsearch – mye mer enn søk! [JavaZone 2013]
Elasticsearch – mye mer enn søk! [JavaZone 2013]foundsearch
 
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
 
Real-time search in Drupal with Elasticsearch @Moldcamp
Real-time search in Drupal with Elasticsearch @MoldcampReal-time search in Drupal with Elasticsearch @Moldcamp
Real-time search in Drupal with Elasticsearch @MoldcampAlexei Gorobets
 
Elasticsearch & "PeopleSearch"
Elasticsearch & "PeopleSearch"Elasticsearch & "PeopleSearch"
Elasticsearch & "PeopleSearch"George Stathis
 
Finding the right stuff, an intro to Elasticsearch (at Rug::B)
Finding the right stuff, an intro to Elasticsearch (at Rug::B) Finding the right stuff, an intro to Elasticsearch (at Rug::B)
Finding the right stuff, an intro to Elasticsearch (at Rug::B) Michael Reinsch
 
Elastic search and Symfony3 - A practical approach
Elastic search and Symfony3 - A practical approachElastic search and Symfony3 - A practical approach
Elastic search and Symfony3 - A practical approachSymfonyMu
 
OData: Universal Data Solvent or Clunky Enterprise Goo? (GlueCon 2015)
OData: Universal Data Solvent or Clunky Enterprise Goo? (GlueCon 2015)OData: Universal Data Solvent or Clunky Enterprise Goo? (GlueCon 2015)
OData: Universal Data Solvent or Clunky Enterprise Goo? (GlueCon 2015)Pat Patterson
 
Making your elastic cluster perform - Jettro Coenradie - Codemotion Amsterdam...
Making your elastic cluster perform - Jettro Coenradie - Codemotion Amsterdam...Making your elastic cluster perform - Jettro Coenradie - Codemotion Amsterdam...
Making your elastic cluster perform - Jettro Coenradie - Codemotion Amsterdam...Codemotion
 
Peggy elasticsearch應用
Peggy elasticsearch應用Peggy elasticsearch應用
Peggy elasticsearch應用LearningTech
 
Elasticsearch intro output
Elasticsearch intro outputElasticsearch intro output
Elasticsearch intro outputTom Chen
 
REST with Eve and Python
REST with Eve and PythonREST with Eve and Python
REST with Eve and PythonPiXeL16
 
Overview of GraphQL & Clients
Overview of GraphQL & ClientsOverview of GraphQL & Clients
Overview of GraphQL & ClientsPokai Chang
 
Stop the noise! - Introduction to the JSON:API specification in Drupal
Stop the noise! - Introduction to the JSON:API specification in DrupalStop the noise! - Introduction to the JSON:API specification in Drupal
Stop the noise! - Introduction to the JSON:API specification in DrupalBjörn Brala
 
GraphQL & Relay - 串起前後端世界的橋樑
GraphQL & Relay - 串起前後端世界的橋樑GraphQL & Relay - 串起前後端世界的橋樑
GraphQL & Relay - 串起前後端世界的橋樑Pokai Chang
 
Elasticsearch sur Azure : Make sense of your (BIG) data !
Elasticsearch sur Azure : Make sense of your (BIG) data !Elasticsearch sur Azure : Make sense of your (BIG) data !
Elasticsearch sur Azure : Make sense of your (BIG) data !Microsoft
 
Finding the right stuff, an intro to Elasticsearch with Ruby/Rails
Finding the right stuff, an intro to Elasticsearch with Ruby/RailsFinding the right stuff, an intro to Elasticsearch with Ruby/Rails
Finding the right stuff, an intro to Elasticsearch with Ruby/RailsMichael Reinsch
 
Introduction to Elasticsearch
Introduction to ElasticsearchIntroduction to Elasticsearch
Introduction to ElasticsearchRuslan Zavacky
 

Similaire à Elasticsearch in 15 minutes (20)

Elasticsearch in 15 Minutes
Elasticsearch in 15 MinutesElasticsearch in 15 Minutes
Elasticsearch in 15 Minutes
 
elasticsearch basics workshop
elasticsearch basics workshopelasticsearch basics workshop
elasticsearch basics workshop
 
Elasticsearch – mye mer enn søk! [JavaZone 2013]
Elasticsearch – mye mer enn søk! [JavaZone 2013]Elasticsearch – mye mer enn søk! [JavaZone 2013]
Elasticsearch – mye mer enn søk! [JavaZone 2013]
 
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
 
Real-time search in Drupal with Elasticsearch @Moldcamp
Real-time search in Drupal with Elasticsearch @MoldcampReal-time search in Drupal with Elasticsearch @Moldcamp
Real-time search in Drupal with Elasticsearch @Moldcamp
 
Elasticsearch & "PeopleSearch"
Elasticsearch & "PeopleSearch"Elasticsearch & "PeopleSearch"
Elasticsearch & "PeopleSearch"
 
JSON and the APInauts
JSON and the APInautsJSON and the APInauts
JSON and the APInauts
 
Finding the right stuff, an intro to Elasticsearch (at Rug::B)
Finding the right stuff, an intro to Elasticsearch (at Rug::B) Finding the right stuff, an intro to Elasticsearch (at Rug::B)
Finding the right stuff, an intro to Elasticsearch (at Rug::B)
 
Elastic search and Symfony3 - A practical approach
Elastic search and Symfony3 - A practical approachElastic search and Symfony3 - A practical approach
Elastic search and Symfony3 - A practical approach
 
OData: Universal Data Solvent or Clunky Enterprise Goo? (GlueCon 2015)
OData: Universal Data Solvent or Clunky Enterprise Goo? (GlueCon 2015)OData: Universal Data Solvent or Clunky Enterprise Goo? (GlueCon 2015)
OData: Universal Data Solvent or Clunky Enterprise Goo? (GlueCon 2015)
 
Making your elastic cluster perform - Jettro Coenradie - Codemotion Amsterdam...
Making your elastic cluster perform - Jettro Coenradie - Codemotion Amsterdam...Making your elastic cluster perform - Jettro Coenradie - Codemotion Amsterdam...
Making your elastic cluster perform - Jettro Coenradie - Codemotion Amsterdam...
 
Peggy elasticsearch應用
Peggy elasticsearch應用Peggy elasticsearch應用
Peggy elasticsearch應用
 
Elasticsearch intro output
Elasticsearch intro outputElasticsearch intro output
Elasticsearch intro output
 
REST with Eve and Python
REST with Eve and PythonREST with Eve and Python
REST with Eve and Python
 
Overview of GraphQL & Clients
Overview of GraphQL & ClientsOverview of GraphQL & Clients
Overview of GraphQL & Clients
 
Stop the noise! - Introduction to the JSON:API specification in Drupal
Stop the noise! - Introduction to the JSON:API specification in DrupalStop the noise! - Introduction to the JSON:API specification in Drupal
Stop the noise! - Introduction to the JSON:API specification in Drupal
 
GraphQL & Relay - 串起前後端世界的橋樑
GraphQL & Relay - 串起前後端世界的橋樑GraphQL & Relay - 串起前後端世界的橋樑
GraphQL & Relay - 串起前後端世界的橋樑
 
Elasticsearch sur Azure : Make sense of your (BIG) data !
Elasticsearch sur Azure : Make sense of your (BIG) data !Elasticsearch sur Azure : Make sense of your (BIG) data !
Elasticsearch sur Azure : Make sense of your (BIG) data !
 
Finding the right stuff, an intro to Elasticsearch with Ruby/Rails
Finding the right stuff, an intro to Elasticsearch with Ruby/RailsFinding the right stuff, an intro to Elasticsearch with Ruby/Rails
Finding the right stuff, an intro to Elasticsearch with Ruby/Rails
 
Introduction to Elasticsearch
Introduction to ElasticsearchIntroduction to Elasticsearch
Introduction to Elasticsearch
 

Plus de David Pilato

2018-10-02 - Un moteur de recherche NoSQL pour chercher^H^H^H^H^H^H^H^H trouv...
2018-10-02 - Un moteur de recherche NoSQL pour chercher^H^H^H^H^H^H^H^H trouv...2018-10-02 - Un moteur de recherche NoSQL pour chercher^H^H^H^H^H^H^H^H trouv...
2018-10-02 - Un moteur de recherche NoSQL pour chercher^H^H^H^H^H^H^H^H trouv...David Pilato
 
Managing your black friday logs Voxxed Luxembourg
Managing your black friday logs Voxxed LuxembourgManaging your black friday logs Voxxed Luxembourg
Managing your black friday logs Voxxed LuxembourgDavid Pilato
 
Un moteur de recherche NoSQL pour chercher^H^H^H^H^H^H^H^H trouver...
Un moteur de recherche NoSQL pour chercher^H^H^H^H^H^H^H^H trouver...Un moteur de recherche NoSQL pour chercher^H^H^H^H^H^H^H^H trouver...
Un moteur de recherche NoSQL pour chercher^H^H^H^H^H^H^H^H trouver...David Pilato
 
Managing your Black Friday Logs NDC Oslo
Managing your  Black Friday Logs NDC OsloManaging your  Black Friday Logs NDC Oslo
Managing your Black Friday Logs NDC OsloDavid Pilato
 
Managing your black friday logs - Code Europe
Managing your black friday logs - Code EuropeManaging your black friday logs - Code Europe
Managing your black friday logs - Code EuropeDavid Pilato
 
Managing your black Friday logs - CloudConf.IT
Managing your black Friday logs - CloudConf.ITManaging your black Friday logs - CloudConf.IT
Managing your black Friday logs - CloudConf.ITDavid Pilato
 
Elastify you application: from SQL to NoSQL in less than one hour!
Elastify you application: from SQL to NoSQL in less than one hour!Elastify you application: from SQL to NoSQL in less than one hour!
Elastify you application: from SQL to NoSQL in less than one hour!David Pilato
 
Elasticsearch - Esme sudria
Elasticsearch - Esme sudriaElasticsearch - Esme sudria
Elasticsearch - Esme sudriaDavid Pilato
 
Lausanne JUG - Elasticsearch
Lausanne JUG - ElasticsearchLausanne JUG - Elasticsearch
Lausanne JUG - ElasticsearchDavid Pilato
 
Normandy JUG - Elasticsearch
Normandy JUG - ElasticsearchNormandy JUG - Elasticsearch
Normandy JUG - ElasticsearchDavid Pilato
 
Paris data geek - Elasticsearch
Paris data geek - ElasticsearchParis data geek - Elasticsearch
Paris data geek - ElasticsearchDavid Pilato
 
Nantes JUG - Elasticsearch
Nantes JUG - ElasticsearchNantes JUG - Elasticsearch
Nantes JUG - ElasticsearchDavid Pilato
 
Finist JUG - Elasticsearch
Finist JUG - ElasticsearchFinist JUG - Elasticsearch
Finist JUG - ElasticsearchDavid Pilato
 
Poitou charentes JUG - Elasticsearch
Poitou charentes JUG - ElasticsearchPoitou charentes JUG - Elasticsearch
Poitou charentes JUG - ElasticsearchDavid Pilato
 
Elasticsearch - Montpellier JUG
Elasticsearch - Montpellier JUGElasticsearch - Montpellier JUG
Elasticsearch - Montpellier JUGDavid Pilato
 
Lyon JUG - Elasticsearch
Lyon JUG - ElasticsearchLyon JUG - Elasticsearch
Lyon JUG - ElasticsearchDavid Pilato
 
Elasticsearch - OSDC France 2012
Elasticsearch - OSDC France 2012Elasticsearch - OSDC France 2012
Elasticsearch - OSDC France 2012David Pilato
 
Hands on lab Elasticsearch
Hands on lab ElasticsearchHands on lab Elasticsearch
Hands on lab ElasticsearchDavid Pilato
 
Elasticsearch - Devoxx France 2012 - English version
Elasticsearch - Devoxx France 2012 - English versionElasticsearch - Devoxx France 2012 - English version
Elasticsearch - Devoxx France 2012 - English versionDavid Pilato
 
Elasticsearch - Devoxx France 2012
Elasticsearch - Devoxx France 2012Elasticsearch - Devoxx France 2012
Elasticsearch - Devoxx France 2012David Pilato
 

Plus de David Pilato (20)

2018-10-02 - Un moteur de recherche NoSQL pour chercher^H^H^H^H^H^H^H^H trouv...
2018-10-02 - Un moteur de recherche NoSQL pour chercher^H^H^H^H^H^H^H^H trouv...2018-10-02 - Un moteur de recherche NoSQL pour chercher^H^H^H^H^H^H^H^H trouv...
2018-10-02 - Un moteur de recherche NoSQL pour chercher^H^H^H^H^H^H^H^H trouv...
 
Managing your black friday logs Voxxed Luxembourg
Managing your black friday logs Voxxed LuxembourgManaging your black friday logs Voxxed Luxembourg
Managing your black friday logs Voxxed Luxembourg
 
Un moteur de recherche NoSQL pour chercher^H^H^H^H^H^H^H^H trouver...
Un moteur de recherche NoSQL pour chercher^H^H^H^H^H^H^H^H trouver...Un moteur de recherche NoSQL pour chercher^H^H^H^H^H^H^H^H trouver...
Un moteur de recherche NoSQL pour chercher^H^H^H^H^H^H^H^H trouver...
 
Managing your Black Friday Logs NDC Oslo
Managing your  Black Friday Logs NDC OsloManaging your  Black Friday Logs NDC Oslo
Managing your Black Friday Logs NDC Oslo
 
Managing your black friday logs - Code Europe
Managing your black friday logs - Code EuropeManaging your black friday logs - Code Europe
Managing your black friday logs - Code Europe
 
Managing your black Friday logs - CloudConf.IT
Managing your black Friday logs - CloudConf.ITManaging your black Friday logs - CloudConf.IT
Managing your black Friday logs - CloudConf.IT
 
Elastify you application: from SQL to NoSQL in less than one hour!
Elastify you application: from SQL to NoSQL in less than one hour!Elastify you application: from SQL to NoSQL in less than one hour!
Elastify you application: from SQL to NoSQL in less than one hour!
 
Elasticsearch - Esme sudria
Elasticsearch - Esme sudriaElasticsearch - Esme sudria
Elasticsearch - Esme sudria
 
Lausanne JUG - Elasticsearch
Lausanne JUG - ElasticsearchLausanne JUG - Elasticsearch
Lausanne JUG - Elasticsearch
 
Normandy JUG - Elasticsearch
Normandy JUG - ElasticsearchNormandy JUG - Elasticsearch
Normandy JUG - Elasticsearch
 
Paris data geek - Elasticsearch
Paris data geek - ElasticsearchParis data geek - Elasticsearch
Paris data geek - Elasticsearch
 
Nantes JUG - Elasticsearch
Nantes JUG - ElasticsearchNantes JUG - Elasticsearch
Nantes JUG - Elasticsearch
 
Finist JUG - Elasticsearch
Finist JUG - ElasticsearchFinist JUG - Elasticsearch
Finist JUG - Elasticsearch
 
Poitou charentes JUG - Elasticsearch
Poitou charentes JUG - ElasticsearchPoitou charentes JUG - Elasticsearch
Poitou charentes JUG - Elasticsearch
 
Elasticsearch - Montpellier JUG
Elasticsearch - Montpellier JUGElasticsearch - Montpellier JUG
Elasticsearch - Montpellier JUG
 
Lyon JUG - Elasticsearch
Lyon JUG - ElasticsearchLyon JUG - Elasticsearch
Lyon JUG - Elasticsearch
 
Elasticsearch - OSDC France 2012
Elasticsearch - OSDC France 2012Elasticsearch - OSDC France 2012
Elasticsearch - OSDC France 2012
 
Hands on lab Elasticsearch
Hands on lab ElasticsearchHands on lab Elasticsearch
Hands on lab Elasticsearch
 
Elasticsearch - Devoxx France 2012 - English version
Elasticsearch - Devoxx France 2012 - English versionElasticsearch - Devoxx France 2012 - English version
Elasticsearch - Devoxx France 2012 - English version
 
Elasticsearch - Devoxx France 2012
Elasticsearch - Devoxx France 2012Elasticsearch - Devoxx France 2012
Elasticsearch - Devoxx France 2012
 

Dernier

SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 

Dernier (20)

SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 

Elasticsearch in 15 minutes

  • 1. David Pilato @dadoonet elasticsearch in 15 minutes mercredi 3 juillet 13
  • 2. Elasticsearch.com • Créée en 2012 par les auteurs d’Elasticsearch • Formation (publique et intra) • Consulting (support dév) • Abonnement annuel support pour la production avec 3 niveaux de SLA mercredi 3 juillet 13
  • 4. Installation $ wget https://download.elasticsearch.org/... $ tar -xf elasticsearch-0.90.2.tar.gz $ ./elasticsearch-0.90.2/bin/elasticsearch -f ... [INFO ][node][Ghost Maker] {0.90.2}[5645]: initializing ... mercredi 3 juillet 13
  • 5. Index a document... $ curl -XPUT localhost:9200/products/product/1 -d '{ "title" : "Welcome!" }' mercredi 3 juillet 13
  • 6. Update a document... $ curl -XPUT localhost:9200/products/product/1 -d '{ "title" : "Welcome to the Elasticsearch meetup!" }' mercredi 3 juillet 13
  • 7. { "id" : "abc123", "title" : "A JSON Document", "body" : "A JSON document is a ...", "published_on" : "2013/06/27 10:00:00", "featured" : true, "tags" : ["search", "json"], "author" : { "first_name" : "Clara", "last_name" : "Rice", "email" : "clara@rice.org" } } Documents as JSON Data structure with basic types, arrays and deep hierarchies mercredi 3 juillet 13
  • 8. Search for documents.... $ curl localhost:9200/products/_search?q=welcome mercredi 3 juillet 13
  • 9. Add a node... $ ./elasticsearch-0.90.2/bin/elasticsearch -f -D es.node.name=Node2 ...[cluster.service] [Node2] detected_master [Node1] ... mercredi 3 juillet 13
  • 10. Add a node... $ ./elasticsearch-0.90.2/bin/elasticsearch -f -D es.node.name=Node2 ...[cluster.service] [Node2] detected_master [Node1] ... mercredi 3 juillet 13
  • 11. Add another node... $ ./elasticsearch-0.90.2/bin/elasticsearch -f -D es.node.name=Node3 ...[cluster.service] [Node3] detected_master [Node1] ... mercredi 3 juillet 13
  • 12. Add another node... $ ./elasticsearch-0.90.2/bin/elasticsearch -f -D es.node.name=Node3 ...[cluster.service] [Node3] detected_master [Node1] ... mercredi 3 juillet 13
  • 13. Add another node... $ ./elasticsearch-0.90.2/bin/elasticsearch -f -D es.node.name=Node3 ...[cluster.service] [Node3] detected_master [Node1] ... "index.routing.allocation.exclude.name" : "Node1" "cluster.routing.allocation.exclude.name" : "Node3" mercredi 3 juillet 13
  • 15. Until you know what to tweak... mercredi 3 juillet 13
  • 17. Terms apple apple iphone Phrases "apple iphone" Proximity "apple safari"~5 Fuzzy apple~0.8 Wildcards app* *pp* Boosting apple^10 safari Range [2011/05/01 TO 2011/05/31] [java TO json] Boolean apple AND NOT iphone +apple -iphone (apple OR iphone) AND NOT review Fields title:iphone^15 OR body:iphone published_on:[2011/05/01 TO "2011/05/27 10:00:00"] http://lucene.apache.org/java/3_1_0/queryparsersyntax.html $ curl -XGET "http://localhost:9200/_search?q=<YOUR QUERY>" mercredi 3 juillet 13
  • 18. JSON-based Query DSL curl -XGET localhost:9200/articles/_search -d '{ "query" : { "filtered" : { "query" : { "bool" : { "must" : { "match" : { "author.first_name" : { "query" : "claire", "fuzziness" : 0.1 } } }, "must" : { "multi_match" : { "query" : "elasticsearch", "fields" : ["title^10", "body"] } } } }, "filter": { "and" : [ { "terms" : { "tags" : ["search"] } }, { "range" : { "published_on": {"from": "2013"} } }, { "term" : { "featured" : true } } ] } } } }' mercredi 3 juillet 13
  • 19. JSON-based Query DSL curl -XGET localhost:9200/articles/_search -d '{ "query" : { "filtered" : { "query" : { "bool" : { "must" : { "match" : { "author.first_name" : { "query" : "claire", "fuzziness" : 0.1 } } }, "must" : { "multi_match" : { "query" : "elasticsearch", "fields" : ["title^10", "body"] } } } }, "filter": { "and" : [ { "terms" : { "tags" : ["search"] } }, { "range" : { "published_on": {"from": "2013"} } }, { "term" : { "featured" : true } } ] } } } }' mercredi 3 juillet 13
  • 20. curl -XGET localhost:9200/articles/_search -d '{ "query" : { "filtered" : { "query" : { "bool" : { "must" : { "match" : { "author.first_name" : { "query" : "claire", "fuzziness" : 0.1 } } }, "must" : { "multi_match" : { "query" : "elasticsearch", "fields" : ["title^10", "body"] } } } }, "filter": { "and" : [ { "terms" : { "tags" : ["search"] } }, { "range" : { "published_on": {"from": "2013"} } }, { "term" : { "featured" : true } } ] } } } }' JSON-based Query DSL mercredi 3 juillet 13
  • 21. JSON-based Query DSL curl -XGET localhost:9200/articles/_search -d '{ "query" : { "filtered" : { "query" : { "bool" : { "must" : { "match" : { "author.first_name" : { "query" : "claire", "fuzziness" : 0.1 } } }, "must" : { "multi_match" : { "query" : "elasticsearch", "fields" : ["title^10", "body"] } } } }, "filter": { "and" : [ { "terms" : { "tags" : ["search"] } }, { "range" : { "published_on": {"from": "2013"} } }, { "term" : { "featured" : true } } ] } } } }' mercredi 3 juillet 13
  • 22. JSON-based Query DSL curl -XGET localhost:9200/articles/_search -d '{ "query" : { "filtered" : { "query" : { "bool" : { "must" : { "match" : { "author.first_name" : { "query" : "claire", "fuzziness" : 0.1 } } }, "must" : { "multi_match" : { "query" : "elasticsearch", "fields" : ["title^10", "body"] } } } }, "filter": { "and" : [ { "terms" : { "tags" : ["search"] } }, { "range" : { "published_on": {"from": "2013"} } }, { "term" : { "featured" : true } } ] } } } }' mercredi 3 juillet 13
  • 23. “Find all articles with ‘search’ in their title or body, give matches in titles higher score” Full-text Search “Find all articles from year 2013 tagged ‘search’” Structured Search See custom_score and custom_filters_score queries Custom Scoring “Find all articles with ‘search’ in their title or body, give matches in titles higher score and filter articles from year 2013 tagged ‘search’ “ Combined Search mercredi 3 juillet 13
  • 24. What is really a search engine? mercredi 3 juillet 13
  • 25. What is really a search engine? mercredi 3 juillet 13
  • 26. Fetch document field ➝ Pick configured analyzer ➝ Parse text into tokens ➝ Apply token filters ➝ Store into index What is really a search engine? mercredi 3 juillet 13
  • 28. curl 'localhost:9200/_analyze?pretty&tokenizer=keyword&filters=lowercase' -d 'This is a Test' The _analyze API _analyze?text=...&tokenizer=X&filters=A,B,C mercredi 3 juillet 13
  • 29. curl 'localhost:9200/_analyze?pretty&tokenizer=keyword&filters=lowercase' -d 'This is a Test' The _analyze API { "tokens" : [ { "token" : "this is a test", "start_offset" : 0, "end_offset" : 14, "type" : "word", "position" : 1 } ] } _analyze?text=...&tokenizer=X&filters=A,B,C mercredi 3 juillet 13
  • 30. curl 'localhost:9200/_analyze?pretty&tokenizer=keyword&filters=lowercase' -d 'This is a Test' The _analyze API { "tokens" : [ { "token" : "this is a test", "start_offset" : 0, "end_offset" : 14, "type" : "word", "position" : 1 } ] } _analyze?text=...&tokenizer=X&filters=A,B,C curl 'localhost:9200/_analyze?pretty&analyzer=standard' -d 'This is a Test' mercredi 3 juillet 13
  • 31. curl 'localhost:9200/_analyze?pretty&tokenizer=keyword&filters=lowercase' -d 'This is a Test' The _analyze API { "tokens" : [ { "token" : "this is a test", "start_offset" : 0, "end_offset" : 14, "type" : "word", "position" : 1 } ] } _analyze?text=...&tokenizer=X&filters=A,B,C curl 'localhost:9200/_analyze?pretty&analyzer=standard' -d 'This is a Test' { "tokens" : [ { "token" : "test", "start_offset" : 10, "end_offset" : 14, "type" : "<ALPHANUM>", "position" : 4 } ] } mercredi 3 juillet 13
  • 32. Mapping curl -XPUT localhost:9200/articles/_mapping -d '{ "article" : { "properties" : { "title" : { "type" : "string", "analyzer" : "french" } } } }' Configuring document properties for the search engine mercredi 3 juillet 13
  • 35. Location Product Tim e OLAP Cube Dimensions, measures, aggregations mercredi 3 juillet 13
  • 36. Slice Dice Drill Down / Roll Up Show me sales numbers for all products across all locations in year 2013 Show me product A sales numbers across all locations over all years Show me products sales numbers in location X over all years mercredi 3 juillet 13
  • 37. curl -XPOST 'localhost:9200/articles/_search?search_type=count&pretty' -d '{ "facets": { "tag-cloug": { "terms" : { "field" : "tags" } } } }' “Tag Cloud” With the terms Facet "facets" : { "tag-cloug" : { "terms" : [ { "term" : "ruby", "count" : 3 }, { "term" : "java", "count" : 2 }, ... } ] } } Simplest “map/reduce” aggregation: document count per tag mercredi 3 juillet 13
  • 38. curl -XGET 'localhost:9200/scores/_search/?search_type=count&pretty' -d '{ "facets": { "scores-per-subject" : { "terms_stats" : { "key_field" : "subject", "value_field" : "score" } } } }' Statistics on Student Scores With the terms_stats Facet "facets" : { "scores-per-subject" : { "_type" : "terms_stats", "missing" : 0, "terms" : [ { "term" : "math", "count" : 4, "total_count" : 4, "min" : 25.0, "max" : 92.0, "total" : 267.0, "mean" : 66.75 }, ... ] } } Aggregating statistics per subject mercredi 3 juillet 13
  • 39. curl -X GET 'localhost:9200/demo-scores/_search/?search_type=count&pretty' '{ "query" : { "match" : { "student" : "john" } }, "facets": { "scores-per-subject" : { "terms_stats" : { "key_field" : "subject", "value_field" : "score" } } } }' Statistics on Student Scores With the terms_stats Facet "facets" : { "scores-per-subject" : { "_type" : "terms_stats", "missing" : 0, "terms" : [ { "term" : "math", "count" : 1, "total_count" : 1, "min" : 85.0, "max" : 85.0, "total" : 85.0, "mean" : 85.0 }, ... ] } } Realtime filtering with queries and filters mercredi 3 juillet 13
  • 42. Above & Beyond Bulk operations (For indexing and search operations) Percolator (“reversed search” — alerts, classification, …) Suggesters (“Did you mean …?”) Index aliases (Grouping, filtering or “renaming” of indices) Index templates (Automatic index configuration) Monitoring API (Amount of memory used, number of operations, …) … mercredi 3 juillet 13
  • 43. Above & Beyond Bulk operations (For indexing and search operations) Percolator (“reversed search” — alerts, classification, …) Suggesters (“Did you mean …?”) Index aliases (Grouping, filtering or “renaming” of indices) Index templates (Automatic index configuration) Monitoring API (Amount of memory used, number of operations, …) … GUI? Give Kibana a try http://three.kibana.org/ mercredi 3 juillet 13