ElasticSearch Amaze business, make your devs happy curl -XGET //localhost:9200/ Sebastian Belczyk,...

18
ElasticSearch Amaze business, make your devs happy curl -XGET http ://localhost:9200 / Sebastian Belczyk, @sbelczyk 25/03/2013 #EllerslieDNUG

Transcript of ElasticSearch Amaze business, make your devs happy curl -XGET //localhost:9200/ Sebastian Belczyk,...

Page 1: ElasticSearch Amaze business, make your devs happy curl -XGET //localhost:9200/ Sebastian Belczyk, @sbelczyk25/03/2013 #EllerslieDNUG.

ElasticSearchAmaze business, make your devs happy

curl -XGET http://localhost:9200/

Sebastian Belczyk, @sbelczyk

25/03/2013 #EllerslieDNUG

Page 2: ElasticSearch Amaze business, make your devs happy curl -XGET //localhost:9200/ Sebastian Belczyk, @sbelczyk25/03/2013 #EllerslieDNUG.

ElasticSearch

You know for search

Real time search and analytics engine

No-SQL Document database

Use Lucene for indexing

It’s horizontally and verticaly scalable

Automatic cluster formation

Fault tolerant

Zero config (at the begining)

Nice RESTfull API

Page 3: ElasticSearch Amaze business, make your devs happy curl -XGET //localhost:9200/ Sebastian Belczyk, @sbelczyk25/03/2013 #EllerslieDNUG.

ElasticSearch

SQL DB

Index data

Application

Search and retrive

Page 4: ElasticSearch Amaze business, make your devs happy curl -XGET //localhost:9200/ Sebastian Belczyk, @sbelczyk25/03/2013 #EllerslieDNUG.

Data storege

ElasticSearch stores documents in indices

Each index can contain multiple types of documents

Index is splited into multiple shards

Each shard may be stored on a different node

Page 5: ElasticSearch Amaze business, make your devs happy curl -XGET //localhost:9200/ Sebastian Belczyk, @sbelczyk25/03/2013 #EllerslieDNUG.

Shrads allocation

Node 1P1

P2

P3

Node 1P1

P2

P3

Node 2R1

R2

R3

Page 6: ElasticSearch Amaze business, make your devs happy curl -XGET //localhost:9200/ Sebastian Belczyk, @sbelczyk25/03/2013 #EllerslieDNUG.

Shrads allocation

Node 1P2

P3

Node 2R1

R3

Node 3P1

R2

Node 1R1

P2

P3

Node 2R1

R2

R3

Node 3P1

R2

R3

Page 7: ElasticSearch Amaze business, make your devs happy curl -XGET //localhost:9200/ Sebastian Belczyk, @sbelczyk25/03/2013 #EllerslieDNUG.

Quering Search

Words and n-grams

Geo location

Date and time

Value ranges

Fuzzy maching

Facets and Aggregations

Distinct values for given field with document count

Statistics for numeric fileds (average, min, max)

Time series

Suggestions

Autocomplete

Did you mean

More like

Page 8: ElasticSearch Amaze business, make your devs happy curl -XGET //localhost:9200/ Sebastian Belczyk, @sbelczyk25/03/2013 #EllerslieDNUG.

Query example

Page 9: ElasticSearch Amaze business, make your devs happy curl -XGET //localhost:9200/ Sebastian Belczyk, @sbelczyk25/03/2013 #EllerslieDNUG.

{ "query": { "filtered": { "query": { "match": { "name": { "query": "amd" } } }, "filter": { "bool": { "must": [ { "term": { "category": "CPUs" } }, { "range": { "price": { "from": 200, "to": 300 } } }, { "term": { "cores": "4" } } ] } } } }}

Page 10: ElasticSearch Amaze business, make your devs happy curl -XGET //localhost:9200/ Sebastian Belczyk, @sbelczyk25/03/2013 #EllerslieDNUG.

.net Clients

NEST

PlainElastic.Net

ElasticSearch.NET

Page 11: ElasticSearch Amaze business, make your devs happy curl -XGET //localhost:9200/ Sebastian Belczyk, @sbelczyk25/03/2013 #EllerslieDNUG.
Page 12: ElasticSearch Amaze business, make your devs happy curl -XGET //localhost:9200/ Sebastian Belczyk, @sbelczyk25/03/2013 #EllerslieDNUG.

Scoring

Scoring functions

Boost queries

Boost filters

Decay functions

Custom score functions

Page 13: ElasticSearch Amaze business, make your devs happy curl -XGET //localhost:9200/ Sebastian Belczyk, @sbelczyk25/03/2013 #EllerslieDNUG.

Indexing

ClinetIndex

• Stored in transaction log

Flush

• Indexed in ES

Refresh

• Available for search

Page 14: ElasticSearch Amaze business, make your devs happy curl -XGET //localhost:9200/ Sebastian Belczyk, @sbelczyk25/03/2013 #EllerslieDNUG.

Testing

Page 15: ElasticSearch Amaze business, make your devs happy curl -XGET //localhost:9200/ Sebastian Belczyk, @sbelczyk25/03/2013 #EllerslieDNUG.

Deployment

Requirements:

Java Server JRE

JAVA_HOME variable pointing to JRE (not bin)

Steps

From ElasticSearch dir run bin/service install

Change service start mode to automatic and run service

Page 16: ElasticSearch Amaze business, make your devs happy curl -XGET //localhost:9200/ Sebastian Belczyk, @sbelczyk25/03/2013 #EllerslieDNUG.

Tools

Sense

Kibana

Logstash

Marvel

Rivers

Page 17: ElasticSearch Amaze business, make your devs happy curl -XGET //localhost:9200/ Sebastian Belczyk, @sbelczyk25/03/2013 #EllerslieDNUG.

Tools