• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Why elasticsearch rocks!
 

Why elasticsearch rocks!

on

  • 2,229 views

 

Statistics

Views

Total Views
2,229
Views on SlideShare
1,590
Embed Views
639

Actions

Likes
4
Downloads
17
Comments
0

7 Embeds 639

http://www.alpesjug.fr 289
http://www.alpesjug.org 274
https://twitter.com 28
http://localhost 19
http://alpesjug.org 15
http://abtasty.com 13
http://translate.googleusercontent.com 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Why elasticsearch rocks! Why elasticsearch rocks! Presentation Transcript

    • WhyElasticsearch rocks ! AlpesJUG – 19 février 2013
    • Tanguy Leroux● Consultant et Formateur @ Zenika● Elasticsearch Addict● @tlrx● http://github.com/tlrx● tlrx.dev@gmail.com
    • Un projet Open source+ 700 forks +3500 watchers +100 commiters GitHub Apache 2 License
    • Basé surApache lucene Version 3.6.2, bientôt la 4.1
    • Une installationZERO CONFIGDécompresser. Exécuter. Ça marche.
    • Orientédocument JSON
    • personne{ "nom" : "Reinhardt", "prenom" : "Jean Django", "date_naissance" : "1910-10-23"}
    • film{ "titre" : "Django Unchained", "genre" : "western", "date_sortie" : "2013-01-16"}
    • Elasticsearch / SGBD Index → Base de données Type → TableDocument → Row Field → ColumnMapping → Schema
    • Elasticsearch est SCHEMA LeSSLa structure des documents peut évoluer avec le temps
    • Aujourdhui{ "titre" : "Django Unchained", "genre" : "western", "date_sortie": "2013-01-16"}
    • demain{ "titre" : "Django Unchained", "genre" : "western", "date_sortie" : "2013-01-16", "realisateur" : { "nom" : "Tarantino", "prenom" : "Quentin" }, "nb_entrees" : 3159385, "acteurs" : [ { "nom" : "Foxx", "prenom" : "Jamie" }, { "nom" : "Waltz", "prenom" : "Christoph" }, { "nom" : "Tarantino", "prenom" : "Quentin" } ]}
    • Recherche de « tarantino »{ "titre" : "Django Unchained", "genre" : "western", "date_sortie" : "2013-01-16", "realisateur" : { "nom" : "Tarantino", "prenom" : "Quentin" }, "nb_entrees" : 3159385, "acteurs" : [ { "nom" : "Foxx", "prenom" : "Jamie" }, { "nom" : "Waltz", "prenom" : "Christoph" }, { "nom" : "Tarantino", "prenom" : "Quentin" } ]}
    • Recherche de « django » film personne{ "titre" : "Django Unchained", "genre" : "western", { "date_sortie" : "2013-01-16", "realisateur" : { "nom" : "Reinhardt", "nom" : "Tarantino", "prenom" : "Jean Django", "prenom" : "Quentin" "date_naissance" : "1910-10-23" }, } "nb_entrees" : 3159385, "acteurs" : [...]}
    • Un moteur de recherche restfulhttp://HOST:PORT/index(s)/type(s)/_action|id Méthodes HTTP: GET, PUT, POST, DELETE
    • ExemplesIndexer un document Put http://HOST:PORT/mediatheque/film/1 POSt http://HOST:PORT/mediatheque/film/Récupérer un document get http://HOST:PORT/mediatheque/film/1Supprimer un document delete http://HOST:PORT/mediatheque/film/1Créer un index post http://HOST:PORT/mediatheque/musiqueRechercher get http://HOST:PORT/mediatheque/film/_search?q=django get http://HOST:PORT/_search?q=django
    • Un langage de requêtes Query dslmatch, field, query_string, bool, term, Fuzzy, match_all,more like this, geo, Range, wildcard, span, ...
    • De nombreuses Facettesterms, histogram, date histogram, range, Stats, geo distance, filter, query ...
    • facette « terms »curl -XGET localhost:9200/_search -d { "query": { "match": { "titre": "django hard" } }, "facets": { "facet_genres": { "terms": { "field": "genre" } } }}
    • facette « terms »{... "hits":{ ... }, "facets":{ "facet_genres":{ "_type":"terms", "missing":0, "total":2, "other":0, "terms":[ {"term":"western","count":1}, {"term":"action","count":1} ] } }}
    • facette « terms »{... "hits":{ ... }, "facets":{ "facet_genres":{ "_type":"terms", "missing":0, "total":2, "other":0, "terms":[ {"term":"western","count":1}, {"term":"action","count":1} ] } }}
    • facette «histogramme»curl -XGET localhost:9200/media/film_search -d { "query": { "match_all": {} }, "facets": { "facet_entrees": { "histogram": { "field": "nb_entrees", "interval": "1000000" } } }}
    • facette «histogramme»{ "hits": { … }, "facets": { "facet_entrees": { "_type": "histogram", "entries": [ { "key": 1000000, "count": 1 }, { "key": 2000000, "count": 1 }, { "key": 3000000, "count": 1 } ] } }}
    • facette «histogramme»{ "hits": { … }, "facets": { "facet_entrees": { "_type": "histogram", "entries": [ { "key": 1000000, "count": 1 }, { "key": 2000000, "count": 1 }, { "key": 3000000, "count": 1 } ] } }}
    • Elasticsearch est distribuéPlusieurs nœuds communiquent en uni/multicast Node master, data, http ...
    • Ils ont aussi pensé à lasupervision
    • Elasticsearch est100 % Java
    • Mais aussi tout plein dautres clientsPhp, perl, scala, python, shell, ruby,.Net, Grails, play !, flume, clojure, Puppet, chef,...
    • Un gros paquet de pluginsPlugin danalyse, rivers, transport, Site, misc, ...
    • Extraction de texte avecApache tika
    • Lindexation facilitée avec les riversJdbc, Mongodb, couchdb, rabbitmq, activemq, Ldap, rss, twitter, wikipedia, ...
    • Jdbc river plugincurl -XPUT localhost:9200/_river/my_jdbc_river/_meta -d { "type" : "jdbc", "jdbc" : { "driver" : "com.mysql.jdbc.Driver", "url" : "jdbc:mysql://localhost:3306/test", "user" : "", "password" : "", "sql" : "select * from orders" }}
    • LAPIpercolate
    • API percolatecurl -XPUT localhost:9200/_percolator/media/film_box_office -d { "query": { "constant_score": { "filter": { "range": { "nb_entrees": { "from": "5000000", "include_lower": true } } } } }}
    • API percolatecurl -XPOST localhost:9200/media/film/?percolate=* -d { "titre":"Hollywoo", "genre":"drame", "nb_entrees": 6000000}{ "ok":true, "_index":"media", "_type":"film", "_id":"70fc7FMWS8Sdxo733_5sWg", "_version":1, "matches":["film_box_office"]}
    • Et aussiParent/child Warmers Slowlog Script Backup ...
    • Merci ?