2012 06-26 - Apresentação sobre ElasticSearch

46
Getting search working should not be hard. Lucas Catón

description

http://blog.lucascaton.com.br/?p=1373

Transcript of 2012 06-26 - Apresentação sobre ElasticSearch

Page 1: 2012 06-26 - Apresentação sobre ElasticSearch

Getting search working should not be hard.

Lucas Catón

Page 2: 2012 06-26 - Apresentação sobre ElasticSearch

ElasticSearch?Full-text search engine and database.

Page 3: 2012 06-26 - Apresentação sobre ElasticSearch

It’s based on Lucene...

Written in Java (fast!)painless setupopen-source

Page 4: 2012 06-26 - Apresentação sobre ElasticSearch

Real-time searchFull-text search engine and database

CommunicatingJSON over RESTful HTTP

Free search schemaDocument oriented

Page 5: 2012 06-26 - Apresentação sobre ElasticSearch

Cloud-ready & distributedBuilt for the cloud

Highly-availableAlways available

ScalableScale to hundreds

Page 6: 2012 06-26 - Apresentação sobre ElasticSearch
Page 7: 2012 06-26 - Apresentação sobre ElasticSearch

Benchmarks by Socialcast Engineeringhttp://engineering.socialcast.com/2011/05/realtime-search-solr-vs-elasticsearch/

Page 8: 2012 06-26 - Apresentação sobre ElasticSearch

Benchmarks by Socialcast Engineeringhttp://engineering.socialcast.com/2011/05/realtime-search-solr-vs-elasticsearch/

Page 9: 2012 06-26 - Apresentação sobre ElasticSearch

Benchmarks by Socialcast Engineeringhttp://engineering.socialcast.com/2011/05/realtime-search-solr-vs-elasticsearch/

Page 10: 2012 06-26 - Apresentação sobre ElasticSearch

Benchmarks by Socialcast Engineeringhttp://engineering.socialcast.com/2011/05/realtime-search-solr-vs-elasticsearch/

Page 11: 2012 06-26 - Apresentação sobre ElasticSearch

Query DSL

Page 12: 2012 06-26 - Apresentação sobre ElasticSearch

'delete''by'

'query''deletebyquery'

Normalise values

"deleteByQuery"

and search terms

"DELETE QUERY"

Page 13: 2012 06-26 - Apresentação sobre ElasticSearch

'delete''by'

'query''deletebyquery'

Normalise values

"deleteByQuery"

and search terms

"DELETE QUERY"

Analyse

Page 14: 2012 06-26 - Apresentação sobre ElasticSearch

What is stored in ElasticSearch?

Page 15: 2012 06-26 - Apresentação sobre ElasticSearch

{ tweet => "Perl is GREAT!", posted => "2011-08-15", user => { name => "Clinton Gormley", email => "[email protected]" }, tags => ["perl","opinion"], posts => 2}

Document:

Page 16: 2012 06-26 - Apresentação sobre ElasticSearch

{ tweet => "Perl is GREAT!", posted => "2011-08-15", user => { name => "Clinton Gormley", email => "[email protected]" }, tags => ["perl","opinion"], posts => 2}

Document:

Fields

Page 17: 2012 06-26 - Apresentação sobre ElasticSearch

{ tweet => "Perl is GREAT!", posted => "2011-08-15", user => { name => "Clinton Gormley", email => "[email protected]" }, tags => ["perl","opinion"], posts => 2}

Document:Values

Page 18: 2012 06-26 - Apresentação sobre ElasticSearch

Built in analyzers:

Pattern, Language, Snowball, Custom, StandardSimple, Whitespace, Stop, Keyword

Page 19: 2012 06-26 - Apresentação sobre ElasticSearch

keyword:The Brown-Cow's Part_No. #A.BC123-456 [email protected]

whitespace:The, Brown-Cow's, Part_No., #A.BC123-456, [email protected]

simple:the, brown, cow, s, part, no, a, bc, joe, bloggs, com

standard:brown, cow's, part_no, a.bc123, 456, joe, bloggs.com

snowball (English):brown, cow, part_no, a.bc123, 456, joe, bloggs.com

The Brown-Cow's Part_No. #A.BC123-456 [email protected]

Page 20: 2012 06-26 - Apresentação sobre ElasticSearch

RTFM!

Page 21: 2012 06-26 - Apresentação sobre ElasticSearch

Language Analyzers

A set of analyzers aimed at analyzing specific language text. The following types are supported: arabic, armenian, basque, brazilian, bulgarian, catalan, chinese,

cjk, czech, danish, dutch, english, finnish, french, galician, german, greek, hindi, hungarian, indonesian, italian, norwegian, persian, portuguese, romanian,

russian, spanish, swedish, turkish, thai.

Page 22: 2012 06-26 - Apresentação sobre ElasticSearch

ClientsJava, Ruby, PHP, Groovy, Python, Perl, Erlang, .NET, Clojure, Scala...

Page 23: 2012 06-26 - Apresentação sobre ElasticSearch

Ruby clientshttps://github.com/karmi/tireGreat documentation, easy installation, flexible.↪ 43,605 total downloads (rubygems.org)

https://github.com/grantr/rubberbandPoor documentation.↪ 9,570 total downloads (rubygems.org)

https://github.com/wireframe/elastic_searchable/Not very flexible.↪ 16,820 total downloads (rubygems.org)

https://github.com/angelf/escargotNot ready yet (WIP).↪ 998 total downloads (rubygems.org)

Page 24: 2012 06-26 - Apresentação sobre ElasticSearch

Ruby clientshttps://github.com/karmi/tireGreat documentation, easy installation, flexible.↪ 43,605 total downloads (rubygems.org)

https://github.com/grantr/rubberbandPoor documentation.↪ 9,570 total downloads (rubygems.org)

https://github.com/wireframe/elastic_searchable/Not very flexible.↪ 16,820 total downloads (rubygems.org)

https://github.com/angelf/escargotNot ready yet (WIP).↪ 998 total downloads (rubygems.org)

Page 25: 2012 06-26 - Apresentação sobre ElasticSearch
Page 26: 2012 06-26 - Apresentação sobre ElasticSearch
Page 27: 2012 06-26 - Apresentação sobre ElasticSearch

Levenshtein algorithm(similarity based on distance)

Page 28: 2012 06-26 - Apresentação sobre ElasticSearch

Rails

Page 29: 2012 06-26 - Apresentação sobre ElasticSearch
Page 30: 2012 06-26 - Apresentação sobre ElasticSearch
Page 31: 2012 06-26 - Apresentação sobre ElasticSearch
Page 32: 2012 06-26 - Apresentação sobre ElasticSearch

> highlight :tags, :title, :options => { :tag => '<strong>' }

=> "Foo <strong>matched word</strong> Bar"

https://github.com/karmi/tire/blob/master/test/integration/highlight_test.rb

Highlight

Page 33: 2012 06-26 - Apresentação sobre ElasticSearch

Powerfull aggregation feature (Facets)

Page 34: 2012 06-26 - Apresentação sobre ElasticSearch

Powerfull aggregation feature (Facets)

Page 35: 2012 06-26 - Apresentação sobre ElasticSearch

Plugins

How to install:/path/elasticsearch/<version>/bin/plugin -install <plugin_name>

Page 36: 2012 06-26 - Apresentação sobre ElasticSearch

Plugin - elasticsearch-headA web front end for an ElasticSearch cluster

https://github.com/mobz/elasticsearch-head

Page 37: 2012 06-26 - Apresentação sobre ElasticSearch

Plugin - elasticsearch-head

Page 38: 2012 06-26 - Apresentação sobre ElasticSearch

Plugin - elasticsearch-head

Page 39: 2012 06-26 - Apresentação sobre ElasticSearch

Plugin - ParamedicA simple tool to inspect the state and statistics

about ElasticSearch clusters.

https://github.com/karmi/elasticsearch-paramedic

Page 40: 2012 06-26 - Apresentação sobre ElasticSearch

Plugin - Paramedic

Page 41: 2012 06-26 - Apresentação sobre ElasticSearch

Plugin - BigDeskLive charts and statistics for ElasticSearch cluster.

https://github.com/lukas-vlcek/bigdesk

Page 42: 2012 06-26 - Apresentação sobre ElasticSearch

Plugin - BigDesk

Page 43: 2012 06-26 - Apresentação sobre ElasticSearch

Disadvantages=> Uses lots of memory;=> No autowarming;

Page 44: 2012 06-26 - Apresentação sobre ElasticSearch

Interesting reading / referenceOfficial guidehttp://www.elasticsearch.org/guide/

Language Analyzershttp://www.elasticsearch.org/guide/reference/index-modules/analysis/lang-analyzer.html

Terms of endearment – the ElasticSearch Query DSL explainedhttp://www.elasticsearch.org/tutorials/2011/08/28/query-dsl-explained.html

Realtime Search: Solr vs Elasticsearchhttp://engineering.socialcast.com/2011/05/realtime-search-solr-vs-elasticsearch/

The Ruby Toolbox - Elastic Searchhttps://www.ruby-toolbox.com/search?utf8=%E2%9C%93&q=elastic+search

Como adicionar consultas ultra-eficientes em grandes bases de documentoshttp://prezi.com/tdskmzuxflts/como-adicionar-consultas-ultra-eficientes-em-grandes-bases-de-documentos-com-elasticsearch/

Rails Castshttp://railscasts.com/episodes/306-elasticsearch-part-1http://railscasts.com/episodes/307-elasticsearch-part-2 (paid content)

Page 45: 2012 06-26 - Apresentação sobre ElasticSearch

Thank you!

Page 46: 2012 06-26 - Apresentação sobre ElasticSearch

Questions?