Your SlideShare is downloading. ×
Why elasticsearch rocks!
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Why elasticsearch rocks!

2,824
views

Published on

Published in: Technology

0 Comments
5 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
2,824
On Slideshare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
25
Comments
0
Likes
5
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. WhyElasticsearch rocks ! AlpesJUG – 19 février 2013
  • 2. Tanguy Leroux● Consultant et Formateur @ Zenika● Elasticsearch Addict● @tlrx● http://github.com/tlrx● tlrx.dev@gmail.com
  • 3. Un projet Open source+ 700 forks +3500 watchers +100 commiters GitHub Apache 2 License
  • 4. Basé surApache lucene Version 3.6.2, bientôt la 4.1
  • 5. Une installationZERO CONFIGDécompresser. Exécuter. Ça marche.
  • 6. Orientédocument JSON
  • 7. personne{ "nom" : "Reinhardt", "prenom" : "Jean Django", "date_naissance" : "1910-10-23"}
  • 8. film{ "titre" : "Django Unchained", "genre" : "western", "date_sortie" : "2013-01-16"}
  • 9. Elasticsearch / SGBD Index → Base de données Type → TableDocument → Row Field → ColumnMapping → Schema
  • 10. Elasticsearch est SCHEMA LeSSLa structure des documents peut évoluer avec le temps
  • 11. Aujourdhui{ "titre" : "Django Unchained", "genre" : "western", "date_sortie": "2013-01-16"}
  • 12. 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" } ]}
  • 13. 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" } ]}
  • 14. 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" : [...]}
  • 15. Un moteur de recherche restfulhttp://HOST:PORT/index(s)/type(s)/_action|id Méthodes HTTP: GET, PUT, POST, DELETE
  • 16. 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
  • 17. Un langage de requêtes Query dslmatch, field, query_string, bool, term, Fuzzy, match_all,more like this, geo, Range, wildcard, span, ...
  • 18. De nombreuses Facettesterms, histogram, date histogram, range, Stats, geo distance, filter, query ...
  • 19. facette « terms »curl -XGET localhost:9200/_search -d { "query": { "match": { "titre": "django hard" } }, "facets": { "facet_genres": { "terms": { "field": "genre" } } }}
  • 20. facette « terms »{... "hits":{ ... }, "facets":{ "facet_genres":{ "_type":"terms", "missing":0, "total":2, "other":0, "terms":[ {"term":"western","count":1}, {"term":"action","count":1} ] } }}
  • 21. facette « terms »{... "hits":{ ... }, "facets":{ "facet_genres":{ "_type":"terms", "missing":0, "total":2, "other":0, "terms":[ {"term":"western","count":1}, {"term":"action","count":1} ] } }}
  • 22. facette «histogramme»curl -XGET localhost:9200/media/film_search -d { "query": { "match_all": {} }, "facets": { "facet_entrees": { "histogram": { "field": "nb_entrees", "interval": "1000000" } } }}
  • 23. facette «histogramme»{ "hits": { … }, "facets": { "facet_entrees": { "_type": "histogram", "entries": [ { "key": 1000000, "count": 1 }, { "key": 2000000, "count": 1 }, { "key": 3000000, "count": 1 } ] } }}
  • 24. facette «histogramme»{ "hits": { … }, "facets": { "facet_entrees": { "_type": "histogram", "entries": [ { "key": 1000000, "count": 1 }, { "key": 2000000, "count": 1 }, { "key": 3000000, "count": 1 } ] } }}
  • 25. Elasticsearch est distribuéPlusieurs nœuds communiquent en uni/multicast Node master, data, http ...
  • 26. Ils ont aussi pensé à lasupervision
  • 27. Elasticsearch est100 % Java
  • 28. Mais aussi tout plein dautres clientsPhp, perl, scala, python, shell, ruby,.Net, Grails, play !, flume, clojure, Puppet, chef,...
  • 29. Un gros paquet de pluginsPlugin danalyse, rivers, transport, Site, misc, ...
  • 30. Extraction de texte avecApache tika
  • 31. Lindexation facilitée avec les riversJdbc, Mongodb, couchdb, rabbitmq, activemq, Ldap, rss, twitter, wikipedia, ...
  • 32. 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" }}
  • 33. LAPIpercolate
  • 34. API percolatecurl -XPUT localhost:9200/_percolator/media/film_box_office -d { "query": { "constant_score": { "filter": { "range": { "nb_entrees": { "from": "5000000", "include_lower": true } } } } }}
  • 35. 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"]}
  • 36. Et aussiParent/child Warmers Slowlog Script Backup ...
  • 37. Merci ?

×