Slide 1

Slide 1 text

Copyright Elasticsearch 2013. Copying, publishing and/or distributing without written permission is strictly prohibited Copyright Elasticsearch 2013. Copying, publishing and/or distributing without written permission is strictly prohibited Deep dive into analytics using Aggregation Boaz Leskes @bleskes

Slide 2

Slide 2 text

Copyright Elasticsearch 2013. Copying, publishing and/or distributing without written permission is strictly prohibited an end-to-end search and analytics platform. Elasticsearch

Slide 3

Slide 3 text

Copyright Elasticsearch 2014. Copying, publishing and/or distributing without written permission is strictly prohibited. • full text search • highlighted search snippets • search-as-you-type • did-you-mean suggestions

Slide 4

Slide 4 text

Copyright Elasticsearch 2014. Copying, publishing and/or distributing without written permission is strictly prohibited. • combines full text search with geolocation • uses more-like-this to find 
 related questions and answers

Slide 5

Slide 5 text

Copyright Elasticsearch 2014. Copying, publishing and/or distributing without written permission is strictly prohibited. • search repositories, users, 
 issues, pull requests • search 130 billion lines of code • track all alerts, events, logs

Slide 6

Slide 6 text

Copyright Elasticsearch 2014. Copying, publishing and/or distributing without written permission is strictly prohibited. • index and analyse 
 5TB of log data every day

Slide 7

Slide 7 text

Copyright Elasticsearch 2014. Copying, publishing and/or distributing without written permission is strictly prohibited. • combine visitor logs with 
 social network data • real-time feedback to editors

Slide 8

Slide 8 text

Copyright Elasticsearch 2014. Copying, publishing and/or distributing without written permission is strictly prohibited.

Slide 9

Slide 9 text

Copyright Elasticsearch 2013. Copying, publishing and/or distributing without written permission is strictly prohibited Feature summary • Fully-featured search Relevance-ranked text search Scalable search High-performance geo, temporal, numeric range and key lookup Highlighting Support for complex document types (nested structures) * Spelling suggestions Powerful query DSL * “Standing” queries * Real-time results * Extensible via plugins * ! • Powerful faceting/analysis Summarise large sets by any combinations of time, geo, category and more. * “Kibana” visualisation tool * ! • Management Simple and robust deployments * REST APIs for handling all aspects of administration/monitoring * “Marvel” console for monitoring and administering clusters * Special features to manage the life cycle of content * • Integration Hadoop (MapRed,Hive, Pig, Cascading..)* Client libraries (Python, Java, Ruby, javascript…) Data connectors (Twitter, JMS…) Logstash ETL framework * • Support Development and Production support with tiered levels Support staff are the core developers of the product * * Features we see as differentiators

Slide 10

Slide 10 text

Copyright Elasticsearch 2013. Copying, publishing and/or distributing without written permission is strictly prohibited data === json Let’s talk data

Slide 11

Slide 11 text

Copyright Elasticsearch 2013. Copying, publishing and/or distributing without written permission is strictly prohibited { "created_at": "Mon Apr 28 12:31:48 +0000 2014", "id": 460758276159062000, "text": "Prepping up for my talk tomorrow at #noslq14 Cologne, where I’ll spend the coming two days. Drop by for everything #elasticsearch related.", "user": { "id": 15037017, "name": "Boaz Leskes", "screen_name": "bleskes", "location": "Amsterdam", "description": "Coder at Elasticsearch", "time_zone": "Amsterdam", }, "geo": null, "retweet_count": 1, "entities": { "hashtags": [ { "text": “noslq14” }, { "text": “elasticsearch" } ], "symbols": [], "urls": [], "user_mentions": [] }, "favorited": false, "retweeted": false, "lang": "en" }

Slide 12

Slide 12 text

Copyright Elasticsearch 2013. Copying, publishing and/or distributing without written permission is strictly prohibited { "dt": "2014-03-03T02:01:48.026Z", "url": "http://www.theguardian.com/film/2014/mar/03/oscars-2014-winners", "queryString": "", "host": "www.theguardian.com", "path": "/film/2014/mar/03/oscars-2014-winners-list", "section": "film", "platform": "r2", "userAgent": { "type": "Browser", "family": "Safari 5.1.9", "os": "OS X 10.6.8", "device": "Personal computer" }, "documentReferrer": "http://www.theguardian.com/world", "browser": { "id": "gA6RUFLhWNQvWdt0rW4r78Fg", "isNew": false }, "referringHost": "theguardian.com", "referringPath": "/world", "isContent": true, "contentPublicationDate": "2014-03-03", "countryCode": "US", "countryName": "United States", "location": { "lonlat": [-73.4409, 41.2094] } }

Slide 13

Slide 13 text

Copyright Elasticsearch 2013. Copying, publishing and/or distributing without written permission is strictly prohibited Data can be anything • Questions • Code • Logs • Credit card transactions • Click logs • …

Slide 14

Slide 14 text

Copyright Elasticsearch 2013. Copying, publishing and/or distributing without written permission is strictly prohibited aggregations == 50km view == patterns

Slide 15

Slide 15 text

Copyright Elasticsearch 2013. Copying, publishing and/or distributing without written permission is strictly prohibited aggregations == 50km view == patterns insights

Slide 16

Slide 16 text

Copyright Elasticsearch 2013. Copying, publishing and/or distributing without written permission is strictly prohibited a simple UI element…

Slide 17

Slide 17 text

Copyright Elasticsearch 2013. Copying, publishing and/or distributing without written permission is strictly prohibited … or more complex …

Slide 18

Slide 18 text

Copyright Elasticsearch 2013. Copying, publishing and/or distributing without written permission is strictly prohibited .. even more complex?

Slide 19

Slide 19 text

Copyright Elasticsearch 2013. Copying, publishing and/or distributing without written permission is strictly prohibited back to search Underpinnings

Slide 20

Slide 20 text

Copyright Elasticsearch 2013. Copying, publishing and/or distributing without written permission is strictly prohibited Powerful search engine GET tweets/tweet/_search { "query": { "filtered": { "query": { "match": { "text": "jumping" } }, "filter": { "range": { "created_at": { "from": "2014-01-28T05:16:29+00:00", "to": "now" } } } } } }

Slide 21

Slide 21 text

Copyright Elasticsearch 2013. Copying, publishing and/or distributing without written permission is strictly prohibited Inverted index nosql 128 New York lat=6.9 lon=50 F 2 6 8 48 112 379 6 9 10 48 11 13 14 134 207 6 9 2 4 9 36 103 310

Slide 22

Slide 22 text

Copyright Elasticsearch 2013. Copying, publishing and/or distributing without written permission is strictly prohibited Our goal 6 8 11 38 153 results

Slide 23

Slide 23 text

Copyright Elasticsearch 2013. Copying, publishing and/or distributing without written permission is strictly prohibited Counting 6 8 11 38 153 results Accessories Lenses Optics Cameras

Slide 24

Slide 24 text

Copyright Elasticsearch 2013. Copying, publishing and/or distributing without written permission is strictly prohibited Counting 6 8 11 38 153 results Accessories Lenses Optics Cameras 3 1 2 0

Slide 25

Slide 25 text

Copyright Elasticsearch 2013. Copying, publishing and/or distributing without written permission is strictly prohibited Field data 2 6 8 48 112 379 6 9 10 48 11 13 14 134 207 6 9 2 4 9 36 103 310 2 4 6 8 9 1 5 5 1 2 4 1 2 4 5 1 nosql 2 128 3 New York 4 lat=6.9 lon=50 5 F

Slide 26

Slide 26 text

Copyright Elasticsearch 2013. Copying, publishing and/or distributing without written permission is strictly prohibited analysis lego Introducing aggregations

Slide 27

Slide 27 text

Copyright Elasticsearch 2013. Copying, publishing and/or distributing without written permission is strictly prohibited Before there were facets • facets are awesome • the serve well and long • but… they are not scalable from a functionality perspective

Slide 28

Slide 28 text

Copyright Elasticsearch 2013. Copying, publishing and/or distributing without written permission is strictly prohibited Analysis lego

Slide 29

Slide 29 text

Copyright Elasticsearch 2013. Copying, publishing and/or distributing without written permission is strictly prohibited Buckets and metrics 6 8 11 38 153 results Accessories Lenses Optics Cameras 3 1 2 0 buckets metrics

Slide 30

Slide 30 text

Copyright Elasticsearch 2013. Copying, publishing and/or distributing without written permission is strictly prohibited Buckets and metrics 6 8 11 38 153 results Accessories Lenses Optics Cameras 3 1 2 0 buckets metrics 2013 2012 2012 2013

Slide 31

Slide 31 text

Copyright Elasticsearch 2013. Copying, publishing and/or distributing without written permission is strictly prohibited json style GET localhost:9200/_search { "aggs" : { "countries" : { "terms" : { "field" : "country" }, "aggs" : { "subjects" : { "terms" : { field" : "subject" }, "aggs" : { "avg_score" : { "avg" : { "field" : "score" } } } } } } } } { "hits" : { ... }, "aggregations" : { "countries" : { "buckets" : [ { "key" : "USA", "doc_count" : 5 "aggregations" : { "subjects" : "buckets" : [ { "key" : "Mathematics", "doc_count" : 3, "aggregations" : { "avg_score" : { "value" : 87.5 } } }, ... ]}}, ... ]} } }

Slide 32

Slide 32 text

Copyright Elasticsearch 2013. Copying, publishing and/or distributing without written permission is strictly prohibited measure all the things • doc count (free!) • avg • min • max • sum • count • stats • extended stats • cardinality • percentiles

Slide 33

Slide 33 text

Copyright Elasticsearch 2013. Copying, publishing and/or distributing without written permission is strictly prohibited Buckets • global • filter • missing • terms • range • date range • ip range • histogram • date histogram • geo distance • nested • geohash grid • significant terms

Slide 34

Slide 34 text

Copyright Elasticsearch 2013. Copying, publishing and/or distributing without written permission is strictly prohibited Example - range bucket GET localhost:9200/grades/grade/_search { "aggs" : { "age_groups" : { "range" : { "field" : "age", "ranges" : [ { "from" : 5, "to" : 10 }, { "from" : 10 } ] }, "aggs" : { "avg_grade" : { "avg" : { "field" : "grade" } } } } } }' "age_groups": { "buckets": [ { "from": 5, "to": 10, "doc_count": 911, "avg_grade": { "value": 81.603 } }, { "from": 10, "doc_count": 2276, "avg_grade": { "value": 82.357 } } ] } !

Slide 35

Slide 35 text

Copyright Elasticsearch 2013. Copying, publishing and/or distributing without written permission is strictly prohibited GET grades/grade/_search { "aggs" : { "grades_distribution" : { "histogram" : { "field" : "grade", "interval" : 10 } } } } Example - histogram

Slide 36

Slide 36 text

Copyright Elasticsearch 2013. Copying, publishing and/or distributing without written permission is strictly prohibited GET grades/grade/_search { "aggs" : { "grades_distribution" : { "histogram" : { "field" : "grade", "interval" : 10 } } } } Example - histogram "aggregations": { "grades_distribution": { "buckets": [ { "key": 60, "doc_count": 467 }, { "key": 70, "doc_count": 873 }, { "key": 80, "doc_count": 930 }, { "key": 90, "doc_count": 915 } ] } } 0 250 500 750 1000 60 70 80 90 915 930 873 467

Slide 37

Slide 37 text

Copyright Elasticsearch 2013. Copying, publishing and/or distributing without written permission is strictly prohibited analytics as search Significant terms

Slide 38

Slide 38 text

Copyright Elasticsearch 2013. Copying, publishing and/or distributing without written permission is strictly prohibited Common crimes GET ukcrimes/_search { "query": { } "aggregations" : { "map" : { "geohash_grid" : { "field":"location", "precision":5, }, "aggregations":{ "most_popular_crime_type":{ "terms":{ "field" : "crime_type", "size" : 1 } } } } } }

Slide 39

Slide 39 text

Copyright Elasticsearch 2013. Copying, publishing and/or distributing without written permission is strictly prohibited Geo-what?

Slide 40

Slide 40 text

Copyright Elasticsearch 2013. Copying, publishing and/or distributing without written permission is strictly prohibited Geo-what?

Slide 41

Slide 41 text

Copyright Elasticsearch 2013. Copying, publishing and/or distributing without written permission is strictly prohibited Geo-what?

Slide 42

Slide 42 text

Copyright Elasticsearch 2013. Copying, publishing and/or distributing without written permission is strictly prohibited The common terms problem

Slide 43

Slide 43 text

Copyright Elasticsearch 2013. Copying, publishing and/or distributing without written permission is strictly prohibited Uncommonly common GET ukcrimes/_search { "query": { } "aggregations" : { "map" : { "geohash_grid" : { "field":"location", "precision":5, }, "aggregations":{ "most_popular_crime_type":{ "significant_terms":{ "field" : "crime_type", "size" : 1 } } } } } }

Slide 44

Slide 44 text

Copyright Elasticsearch 2013. Copying, publishing and/or distributing without written permission is strictly prohibited Uncommonly common

Slide 45

Slide 45 text

Copyright Elasticsearch 2013. Copying, publishing and/or distributing without written permission is strictly prohibited Demo!

Slide 46

Slide 46 text

Copyright Elasticsearch 2014. Copying, publishing and/or distributing without written permission is strictly prohibited thank you! http://elasticsearch.com/support @elasticsearch , @bleskes http://elasticsearch.org/resources