drupalandelasticsearch

46
ELASTICSEARCH The “new school” search engine

Upload: nikolay-ignatov

Post on 15-Apr-2017

170 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: DrupalANDElasticsearch

ELASTICSEARCH

The “new school” search engine

Page 2: DrupalANDElasticsearch

About me - @nignatov

• Founder at NodeSpark

• Using PHP since 2006

• Using Drupal since 2009

• Elasticsearch Connector maintainer

• Love to experiment with new technologies

Page 3: DrupalANDElasticsearch

After the session you should know:

• What is Elasticsearch • How Elasticsearch is working in general • What you can do with Drupal and

Elasticsearch. • Roadmap of the project and some

brain food.

Page 4: DrupalANDElasticsearch

The main goal

GET INLOVE! GET INVOLVED!

Page 5: DrupalANDElasticsearch

Shay Banon • http://thedudeabides.com/ • https://github.com/kimchy • https://twitter.com/kimchy/

Who made Elasticsearch?

Page 6: DrupalANDElasticsearch

Why “new school”?

Page 7: DrupalANDElasticsearch

Who else is using it?

Page 8: DrupalANDElasticsearch

Who is using it?

Page 9: DrupalANDElasticsearch

Visit Elastic{ON} to get more

Page 10: DrupalANDElasticsearch

• Distributed out of the box - Incredible easy to make cluster, just start new node!

• High availability

• Real time index/search • REST API with JSON • Build on top of Apache Lucene and Open Source

http://github.com/elasticsearch/elasticsearch • Schema free • Document oriented

What is Elasticsearch?

Page 11: DrupalANDElasticsearch

Vertical and horizontal scaling

S01

S01

S01

S01 S02 S03 S04+

Page 12: DrupalANDElasticsearch

The feature I really love

Page 13: DrupalANDElasticsearch

How to install it?

Page 14: DrupalANDElasticsearch

How to install it?

Page 15: DrupalANDElasticsearch

How to install it?

Page 16: DrupalANDElasticsearch

… or Found.no

https://found.no

Page 17: DrupalANDElasticsearch

Some terms before we start

RELATIONAL DB ELASTICSEARCH

Database Index

Tables Types

Rows Documents

Column Field

Page 18: DrupalANDElasticsearch

Indices API – Create index

index

Page 19: DrupalANDElasticsearch

How distributed works?

Node2

Node 1

PUT /twitter index: number_of_shards:3 number_of_replicas:1

1P 2P

3P

2P 1R

3R

2R

Node3

3P 1R3R

2R3R

Page 20: DrupalANDElasticsearch

Node2

Multiple indices

Node 1

1P 2P2R

Node3

3P 1R3R

PUT /news?pretty index: number_of_shards:3 number_of_replicas:1

1NP 2NR 2NP 3NR 3NP 1NR

Node2

Node 1

1P 2P2R

Node3

3P 1R3R

PUT /news?pretty index: number_of_shards:3 number_of_replicas:1

1NP 2NR 2NP 3NR 3NP 1NR

Page 21: DrupalANDElasticsearch

index type id

Index API - Request

Page 22: DrupalANDElasticsearch

Node2

Node 1

PUT /twitter/tweet/1{….}

1P 2P2R

Node3

3P 1R3R

Distributed indexing

Page 23: DrupalANDElasticsearch

Index API - Response

Page 24: DrupalANDElasticsearch

Get API - Req and Res

Page 25: DrupalANDElasticsearch

Node2

Node 1

GET /twitter/tweet/1

1P 2P2R

Node3

3P 1R3R

Distributed GET

Page 26: DrupalANDElasticsearch

PUT the document again or…

Update document

Page 27: DrupalANDElasticsearch

Delete document

Page 28: DrupalANDElasticsearch

Search API - Request

Page 29: DrupalANDElasticsearch

Node2

Node 1

GET /twitter/_search?q=vienna

1P 2P2R

Node3

3P 1R3R

Distributed Search

Page 30: DrupalANDElasticsearch

Delete index

Page 31: DrupalANDElasticsearch

How full text search works?

Search for: “Drupal Camp Vienna has been great!”

Page 32: DrupalANDElasticsearch

1. Separate the string into words 2. Create sorted unique list 3. Specify which documents contains this terms

TERMS DOC 1 DOC 2 DOC 3

drupal X X

camp X X

vienna X X

Has X X

been X X

great X

Inverted index

Page 33: DrupalANDElasticsearch

Tokenization + Normalizationor tokenizer + token filters (>=0)

Analysis

Page 34: DrupalANDElasticsearch

DSL Query language Aggregation API (Facets on steroids) AliasingPercolatingGEO searching Attachments many more

More features

Page 35: DrupalANDElasticsearch

Elasticsearch and Drupal

Page 36: DrupalANDElasticsearch

Drupal 7 EcoSystem

1. Elasticsearch Connector 2. EC Search API 3. EC Views 4. EC Statistics 5. EC Watchdog 6. EC Sequence 7. EC Devel

Page 37: DrupalANDElasticsearch

Drupal 7 Watchdog

Page 38: DrupalANDElasticsearch

Drupal 7 Search API

Page 39: DrupalANDElasticsearch

Drupal 8… still patchable!

Page 40: DrupalANDElasticsearch

Roadmap

• Drupal Abstraction Layer • Vagrant, Travis-CI, and automated

tests • Search API integration • Stand alone views module • Statistics / Personalization • Automatic the “Easy install” library

packing.

Page 41: DrupalANDElasticsearch

Brainstorm – Content hubSite X

Site Y

Site Z

Content Hub

Feed Site

Page 42: DrupalANDElasticsearch

Brainstorm – Headless

NodeJS

Data Warehouse

Drupal CMS

Frontend

Page 43: DrupalANDElasticsearch

Brainstorm – SLA HubSite 01

Site 02

Site 03

Site 04

Site 05

Support Department Monitoring

Page 44: DrupalANDElasticsearch

Brainstorm - PerformanceWeb 01

Web 02

Web 03

Web 04

Web 05

Page 45: DrupalANDElasticsearch

Special thanks!

Page 46: DrupalANDElasticsearch

Thank you!

Questions ?