SlideShare a Scribd company logo
ElasticSearch



Presented by:
Abuzar Hasan
Arkhitech <http://www.arkhitech.com>
History


Shay Baron




Compass in 2004
ElasticSearch in 2010






Written in Java
Cross-platform
Distributed
Users








StumbleUpon
Mozilla
Github

Foursquare
Features


Distributed and Highly Available Search Engine










Each index is fully sharded with a configurable number of shards
Each shard can have one or more replicas
Read / Search operations performed on either one of the replica
shard

Multi Tenant with Multi Types
Various set of APIs
Features


Document Oriented
No need for upfront schema definition






(Near) Real Time Search
Per-Operation Persistence


Single document level operations are atomic, consistent, isolated
and durable
Features


Built on top of Lucene








Each shard is a fully functional Lucene index
All the power of Lucene easily exposed through simple
configuration / plugins
Independent of file format

Open Source under Apache 2 License
Setting Up Elastic Search


Download ElasticSearch (CentOS)
sudo yum install elasticsearch




Start ElasticSearch Server


elasticsearch -f -D
es.config=/usr/local/Cellar/elasticsearch/0.18.5/config/elasticsear
ch.yml
Setting up ElasticSearch w/
Ruby




The ElasticSearch is not ruby specific so 'tire' gem helps ruby
based projects to communicate with ElasticSearch
'tire' gem
https://github.com/karmi/retire




We then need to require following libraries




require 'rubygems'
require 'tire'
Indexing Records




Indexing includes both “Create” and “Update” in CRUD.
In order to make index request for new JSON object, we pass
the following URL


http://localhost:<port>/<index>/<type>/[<id>].
Indexing




Creating an index
curl -XPUT "http://localhost:9200/movies/movie/1" -d'
{


"title": "The Godfather",
"director": "Francis Ford Coppola",
"year": 1972








}'
Indexing Response


After executing the request, we get the following response
{














}

“ok”:
“_index”:
“_type”:
“_id”:
“_version”:

true,
“movies”,
“movie”,
“1”,
1
Retrieving Index


Retrieving the index


curl -XGET "http://localhost:9200/movies/movie/1" -d''
Retrieve Index Response
{














“_index”:
“_type”:
“_id”:
“_version”:
“exists”:
“_source”:










}

}

“movies”,
“movie”,
“1”,
1,
true,
{

"title": "The Godfather",
"director": "Francis Ford Coppola",
"year": 1972
Delete Index


Deleting the index


curl -XDELETE "http://localhost:9200/movies/movie/1" -d''
Demo Application


Demo Application by karmi


$ rails new searchapp -m
https://raw.github.com/karmi/tire/master/exam les/railsapplication-template.rb
Demo: Search App - Model


Model
include Tire::Model::Search
include Tire::Model::Callbacks








These two 'tire' models allow your rails application to use tire
gem for searching purposes
Demo: Search App
- Controller


Controller




@articles = Article.tire.search params[:query]

This line in your search method helps to search using tire gem
Demo: Search App - View


View









<%= form_tag search_articles_path, method: :get do %>
<%= text_field_tag :q, params[:query] %>
<%= submit_tag :search %>
<% end %>
Demo: Search App - Index


Create an index


















Tire.index 'articles' do
delete
create
store :title => 'One', :tags => ['ruby']
store :title => 'Two', :tags => ['ruby', 'python']
store :title => 'Three', :tags => ['java']
store :title => 'Four', :tags => ['ruby', 'php']
refresh
end
Demo: Search App - Index


For custom mapping
Tire.index 'articles' do


delete
create :mappings => {
:article => {
:properties => {
:id
=> { :type => 'string', :index => 'not_analyzed', :include_in_all => false },
:title => { :type => 'string', :boost => 2.0, :analyzer => 'snowball' },
:tags => { :type => 'string', :analyzer => 'keyword' },
:content => { :type => 'string', :analyzer => 'snowball' }
}
}





















}




end
Demo: Search App – Bulk
Indexing




For indexing large amount of data
articles = [












{ :id => '1', :type => 'article', :title => 'one', :tags => ['ruby'] },
{ :id => '2', :type => 'article', :title => 'two', :tags => ['ruby', 'python'] },
{ :id => '3', :type => 'article', :title => 'three', :tags => ['java'] },
{ :id => '4', :type => 'article', :title => 'four', :tags => ['ruby', 'php'] }

]
Use Import






Tire.index 'articles' do
import articles
end
Displaying Facets


For displaying facets
s.results.facets['global-tags']['terms'].each do |f|








puts "#{f['term'].ljust(10)} #{f['count']}"

end

Output








ruby
python
php
java

3
1
1
1
References
• https://github.com/karmi/retire
• http://railscasts.com/episodes/306-elasticsearch-part1

QUESTIONS?

More Related Content

What's hot

Stop Hacking WordPress, Start Working with it - Charly Leetham - WordCamp Syd...
Stop Hacking WordPress, Start Working with it - Charly Leetham - WordCamp Syd...Stop Hacking WordPress, Start Working with it - Charly Leetham - WordCamp Syd...
Stop Hacking WordPress, Start Working with it - Charly Leetham - WordCamp Syd...
WordCamp Sydney
 
Web services with laravel
Web services with laravelWeb services with laravel
Web services with laravel
Confiz
 
เกี่ยวกับ Apache solr 4.0
เกี่ยวกับ Apache solr 4.0เกี่ยวกับ Apache solr 4.0
เกี่ยวกับ Apache solr 4.0
Somkiat Puisungnoen
 
An introduction to Laravel Passport
An introduction to Laravel PassportAn introduction to Laravel Passport
An introduction to Laravel Passport
Michael Peacock
 
ACL in CodeIgniter
ACL in CodeIgniterACL in CodeIgniter
ACL in CodeIgniter
mirahman
 
Djangocon 2014 angular + django
Djangocon 2014 angular + djangoDjangocon 2014 angular + django
Djangocon 2014 angular + django
Nina Zakharenko
 
Action Bar Sherlock tutorial
Action Bar Sherlock tutorialAction Bar Sherlock tutorial
Action Bar Sherlock tutorial
Ahsanul Karim
 
Cusomizing Burp Suite - Getting the Most out of Burp Extensions
Cusomizing Burp Suite - Getting the Most out of Burp ExtensionsCusomizing Burp Suite - Getting the Most out of Burp Extensions
Cusomizing Burp Suite - Getting the Most out of Burp Extensions
August Detlefsen
 
CakeFest 2013 - A-Z REST APIs
CakeFest 2013 - A-Z REST APIsCakeFest 2013 - A-Z REST APIs
CakeFest 2013 - A-Z REST APIs
anthony_putignano
 
Python tools for testing web services over HTTP
Python tools for testing web services over HTTPPython tools for testing web services over HTTP
Python tools for testing web services over HTTP
Mykhailo Kolesnyk
 
Rails3 changesets
Rails3 changesetsRails3 changesets
Rails3 changesets
Wen-Tien Chang
 
Designing CakePHP plugins for consuming APIs
Designing CakePHP plugins for consuming APIsDesigning CakePHP plugins for consuming APIs
Designing CakePHP plugins for consuming APIs
Neil Crookes
 
Lucene for Solr Developers
Lucene for Solr DevelopersLucene for Solr Developers
Lucene for Solr Developers
Erik Hatcher
 
ActionBar and Holo in Android 2+
ActionBar and Holo in Android 2+ActionBar and Holo in Android 2+
ActionBar and Holo in Android 2+
Michal Pavlasek
 
REST Easy with Django-Rest-Framework
REST Easy with Django-Rest-FrameworkREST Easy with Django-Rest-Framework
REST Easy with Django-Rest-Framework
Marcel Chastain
 
OSCON Google App Engine Codelab - July 2010
OSCON Google App Engine Codelab - July 2010OSCON Google App Engine Codelab - July 2010
OSCON Google App Engine Codelab - July 2010
ikailan
 
Enterprise search in_drupal_pub
Enterprise search in_drupal_pubEnterprise search in_drupal_pub
Enterprise search in_drupal_pub
dstuartnz
 
Lucene for Solr Developers
Lucene for Solr DevelopersLucene for Solr Developers
Lucene for Solr Developers
Erik Hatcher
 
Bootstrat REST APIs with Laravel 5
Bootstrat REST APIs with Laravel 5Bootstrat REST APIs with Laravel 5
Bootstrat REST APIs with Laravel 5
Elena Kolevska
 
Rails 3 Beautiful Code
Rails 3 Beautiful CodeRails 3 Beautiful Code
Rails 3 Beautiful Code
GreggPollack
 

What's hot (20)

Stop Hacking WordPress, Start Working with it - Charly Leetham - WordCamp Syd...
Stop Hacking WordPress, Start Working with it - Charly Leetham - WordCamp Syd...Stop Hacking WordPress, Start Working with it - Charly Leetham - WordCamp Syd...
Stop Hacking WordPress, Start Working with it - Charly Leetham - WordCamp Syd...
 
Web services with laravel
Web services with laravelWeb services with laravel
Web services with laravel
 
เกี่ยวกับ Apache solr 4.0
เกี่ยวกับ Apache solr 4.0เกี่ยวกับ Apache solr 4.0
เกี่ยวกับ Apache solr 4.0
 
An introduction to Laravel Passport
An introduction to Laravel PassportAn introduction to Laravel Passport
An introduction to Laravel Passport
 
ACL in CodeIgniter
ACL in CodeIgniterACL in CodeIgniter
ACL in CodeIgniter
 
Djangocon 2014 angular + django
Djangocon 2014 angular + djangoDjangocon 2014 angular + django
Djangocon 2014 angular + django
 
Action Bar Sherlock tutorial
Action Bar Sherlock tutorialAction Bar Sherlock tutorial
Action Bar Sherlock tutorial
 
Cusomizing Burp Suite - Getting the Most out of Burp Extensions
Cusomizing Burp Suite - Getting the Most out of Burp ExtensionsCusomizing Burp Suite - Getting the Most out of Burp Extensions
Cusomizing Burp Suite - Getting the Most out of Burp Extensions
 
CakeFest 2013 - A-Z REST APIs
CakeFest 2013 - A-Z REST APIsCakeFest 2013 - A-Z REST APIs
CakeFest 2013 - A-Z REST APIs
 
Python tools for testing web services over HTTP
Python tools for testing web services over HTTPPython tools for testing web services over HTTP
Python tools for testing web services over HTTP
 
Rails3 changesets
Rails3 changesetsRails3 changesets
Rails3 changesets
 
Designing CakePHP plugins for consuming APIs
Designing CakePHP plugins for consuming APIsDesigning CakePHP plugins for consuming APIs
Designing CakePHP plugins for consuming APIs
 
Lucene for Solr Developers
Lucene for Solr DevelopersLucene for Solr Developers
Lucene for Solr Developers
 
ActionBar and Holo in Android 2+
ActionBar and Holo in Android 2+ActionBar and Holo in Android 2+
ActionBar and Holo in Android 2+
 
REST Easy with Django-Rest-Framework
REST Easy with Django-Rest-FrameworkREST Easy with Django-Rest-Framework
REST Easy with Django-Rest-Framework
 
OSCON Google App Engine Codelab - July 2010
OSCON Google App Engine Codelab - July 2010OSCON Google App Engine Codelab - July 2010
OSCON Google App Engine Codelab - July 2010
 
Enterprise search in_drupal_pub
Enterprise search in_drupal_pubEnterprise search in_drupal_pub
Enterprise search in_drupal_pub
 
Lucene for Solr Developers
Lucene for Solr DevelopersLucene for Solr Developers
Lucene for Solr Developers
 
Bootstrat REST APIs with Laravel 5
Bootstrat REST APIs with Laravel 5Bootstrat REST APIs with Laravel 5
Bootstrat REST APIs with Laravel 5
 
Rails 3 Beautiful Code
Rails 3 Beautiful CodeRails 3 Beautiful Code
Rails 3 Beautiful Code
 

Viewers also liked

QMiner - Data analytics platform for processing large-scale real-time stream...
 QMiner - Data analytics platform for processing large-scale real-time stream... QMiner - Data analytics platform for processing large-scale real-time stream...
QMiner - Data analytics platform for processing large-scale real-time stream...
blazf
 
Hi, today i present you five famous
Hi, today i present you five famousHi, today i present you five famous
Hi, today i present you five famous
Anamaria Pinto
 
Mentoring I
Mentoring IMentoring I
Mentoring I
shendin
 
Factura
FacturaFactura
碳酸鈉81027
碳酸鈉81027碳酸鈉81027
碳酸鈉81027
family
 
Factors that influence path to purchase
Factors that influence path to purchaseFactors that influence path to purchase
Factors that influence path to purchase
Sasmita Pati
 
Xaneiro 2015
Xaneiro 2015Xaneiro 2015
Xaneiro 2015iesasorey
 
Xander santiago 7 b
Xander santiago 7 bXander santiago 7 b
Xander santiago 7 b
Xandermanuel
 
Presentación sobre Diabetes
Presentación sobre DiabetesPresentación sobre Diabetes
Presentación sobre Diabetes
Guadalinfo Albondon
 
HP LaserJet Pro P1606dn – CE278A Toner Replacement
HP LaserJet Pro P1606dn – CE278A Toner ReplacementHP LaserJet Pro P1606dn – CE278A Toner Replacement
HP LaserJet Pro P1606dn – CE278A Toner Replacement
Abdur Rahman Quadri
 
WordPress Theme & Plugin development best practices - phpXperts seminar 2011
WordPress Theme & Plugin development best practices - phpXperts seminar 2011WordPress Theme & Plugin development best practices - phpXperts seminar 2011
WordPress Theme & Plugin development best practices - phpXperts seminar 2011
Tareq Hasan
 
Why Tablets? | 2011
Why Tablets? | 2011Why Tablets? | 2011
Why Tablets? | 2011
Malte Ahrens
 
HAPPYWEEK 202 - 2017.01.16.
HAPPYWEEK 202 - 2017.01.16.HAPPYWEEK 202 - 2017.01.16.
HAPPYWEEK 202 - 2017.01.16.
Jiří Černák
 
Чингэлтэй дүүргийн 9 дүгээр хороо Дэнжийн 1000-ийн дахин төлөвлөлт
Чингэлтэй дүүргийн 9 дүгээр хороо Дэнжийн 1000-ийн дахин төлөвлөлтЧингэлтэй дүүргийн 9 дүгээр хороо Дэнжийн 1000-ийн дахин төлөвлөлт
Чингэлтэй дүүргийн 9 дүгээр хороо Дэнжийн 1000-ийн дахин төлөвлөлт
Есдүгээр Хороо Иргэний Танхим
 
Scan, Focus, Act
Scan, Focus, ActScan, Focus, Act
Scan, Focus, Act
easleyme
 
As noções de erro e fracasso no contexto escolar: algumas considerações preli...
As noções de erro e fracasso no contexto escolar: algumas considerações preli...As noções de erro e fracasso no contexto escolar: algumas considerações preli...
As noções de erro e fracasso no contexto escolar: algumas considerações preli...
Jefjac
 
Avaliação
AvaliaçãoAvaliação
12 Questions to Ask When Making a Content Marketing Technology Decision
12 Questions to Ask When Making a Content Marketing Technology Decision12 Questions to Ask When Making a Content Marketing Technology Decision
12 Questions to Ask When Making a Content Marketing Technology Decision
Content Marketing Institute
 
The Science of Gratitude
The Science of Gratitude The Science of Gratitude
The Science of Gratitude
Globoforce
 
4 Model Kepribadian ( D I S C)
4 Model Kepribadian ( D I S C)4 Model Kepribadian ( D I S C)
4 Model Kepribadian ( D I S C)
Djodi Ismanto
 

Viewers also liked (20)

QMiner - Data analytics platform for processing large-scale real-time stream...
 QMiner - Data analytics platform for processing large-scale real-time stream... QMiner - Data analytics platform for processing large-scale real-time stream...
QMiner - Data analytics platform for processing large-scale real-time stream...
 
Hi, today i present you five famous
Hi, today i present you five famousHi, today i present you five famous
Hi, today i present you five famous
 
Mentoring I
Mentoring IMentoring I
Mentoring I
 
Factura
FacturaFactura
Factura
 
碳酸鈉81027
碳酸鈉81027碳酸鈉81027
碳酸鈉81027
 
Factors that influence path to purchase
Factors that influence path to purchaseFactors that influence path to purchase
Factors that influence path to purchase
 
Xaneiro 2015
Xaneiro 2015Xaneiro 2015
Xaneiro 2015
 
Xander santiago 7 b
Xander santiago 7 bXander santiago 7 b
Xander santiago 7 b
 
Presentación sobre Diabetes
Presentación sobre DiabetesPresentación sobre Diabetes
Presentación sobre Diabetes
 
HP LaserJet Pro P1606dn – CE278A Toner Replacement
HP LaserJet Pro P1606dn – CE278A Toner ReplacementHP LaserJet Pro P1606dn – CE278A Toner Replacement
HP LaserJet Pro P1606dn – CE278A Toner Replacement
 
WordPress Theme & Plugin development best practices - phpXperts seminar 2011
WordPress Theme & Plugin development best practices - phpXperts seminar 2011WordPress Theme & Plugin development best practices - phpXperts seminar 2011
WordPress Theme & Plugin development best practices - phpXperts seminar 2011
 
Why Tablets? | 2011
Why Tablets? | 2011Why Tablets? | 2011
Why Tablets? | 2011
 
HAPPYWEEK 202 - 2017.01.16.
HAPPYWEEK 202 - 2017.01.16.HAPPYWEEK 202 - 2017.01.16.
HAPPYWEEK 202 - 2017.01.16.
 
Чингэлтэй дүүргийн 9 дүгээр хороо Дэнжийн 1000-ийн дахин төлөвлөлт
Чингэлтэй дүүргийн 9 дүгээр хороо Дэнжийн 1000-ийн дахин төлөвлөлтЧингэлтэй дүүргийн 9 дүгээр хороо Дэнжийн 1000-ийн дахин төлөвлөлт
Чингэлтэй дүүргийн 9 дүгээр хороо Дэнжийн 1000-ийн дахин төлөвлөлт
 
Scan, Focus, Act
Scan, Focus, ActScan, Focus, Act
Scan, Focus, Act
 
As noções de erro e fracasso no contexto escolar: algumas considerações preli...
As noções de erro e fracasso no contexto escolar: algumas considerações preli...As noções de erro e fracasso no contexto escolar: algumas considerações preli...
As noções de erro e fracasso no contexto escolar: algumas considerações preli...
 
Avaliação
AvaliaçãoAvaliação
Avaliação
 
12 Questions to Ask When Making a Content Marketing Technology Decision
12 Questions to Ask When Making a Content Marketing Technology Decision12 Questions to Ask When Making a Content Marketing Technology Decision
12 Questions to Ask When Making a Content Marketing Technology Decision
 
The Science of Gratitude
The Science of Gratitude The Science of Gratitude
The Science of Gratitude
 
4 Model Kepribadian ( D I S C)
4 Model Kepribadian ( D I S C)4 Model Kepribadian ( D I S C)
4 Model Kepribadian ( D I S C)
 

Similar to Introduction to ElasticSearch

Selenium & PHPUnit made easy with Steward (Berlin, April 2017)
Selenium & PHPUnit made easy with Steward (Berlin, April 2017)Selenium & PHPUnit made easy with Steward (Berlin, April 2017)
Selenium & PHPUnit made easy with Steward (Berlin, April 2017)
Ondřej Machulda
 
Introduction to Elasticsearch with basics of Lucene
Introduction to Elasticsearch with basics of LuceneIntroduction to Elasticsearch with basics of Lucene
Introduction to Elasticsearch with basics of Lucene
Rahul Jain
 
Apache Lucene: Searching the Web and Everything Else (Jazoon07)
Apache Lucene: Searching the Web and Everything Else (Jazoon07)Apache Lucene: Searching the Web and Everything Else (Jazoon07)
Apache Lucene: Searching the Web and Everything Else (Jazoon07)
dnaber
 
Apache Lucene Searching The Web
Apache Lucene Searching The WebApache Lucene Searching The Web
Apache Lucene Searching The Web
Francisco Gonçalves
 
Mastering Test Automation: How To Use Selenium Successfully
Mastering Test Automation: How To Use Selenium SuccessfullyMastering Test Automation: How To Use Selenium Successfully
Mastering Test Automation: How To Use Selenium Successfully
SpringPeople
 
Prototyping applications with heroku and elasticsearch
 Prototyping applications with heroku and elasticsearch Prototyping applications with heroku and elasticsearch
Prototyping applications with heroku and elasticsearch
protofy
 
SCR Annotations for Fun and Profit
SCR Annotations for Fun and ProfitSCR Annotations for Fun and Profit
SCR Annotations for Fun and Profit
Mike Pfaff
 
Search Engine Capabilities - Apache Solr(Lucene)
Search Engine Capabilities - Apache Solr(Lucene)Search Engine Capabilities - Apache Solr(Lucene)
Search Engine Capabilities - Apache Solr(Lucene)
Manish kumar
 
[2D1]Elasticsearch 성능 최적화
[2D1]Elasticsearch 성능 최적화[2D1]Elasticsearch 성능 최적화
[2D1]Elasticsearch 성능 최적화
NAVER D2
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...
Fabio Franzini
 
[2 d1] elasticsearch 성능 최적화
[2 d1] elasticsearch 성능 최적화[2 d1] elasticsearch 성능 최적화
[2 d1] elasticsearch 성능 최적화
Henry Jeong
 
Tips for Angular Applications
Tips for Angular ApplicationsTips for Angular Applications
Tips for Angular Applications
Sebastian Pederiva
 
Adding High Performance Search to your Grails App
Adding High Performance Search to your Grails AppAdding High Performance Search to your Grails App
Adding High Performance Search to your Grails App
Adam Creeger
 
Ako prepojiť aplikáciu s Elasticsearch
Ako prepojiť aplikáciu s ElasticsearchAko prepojiť aplikáciu s Elasticsearch
Ako prepojiť aplikáciu s Elasticsearch
bart-sk
 
Selenium-Webdriver With PHPUnit Automation test for Joomla CMS!
Selenium-Webdriver With PHPUnit Automation test for Joomla CMS!Selenium-Webdriver With PHPUnit Automation test for Joomla CMS!
Selenium-Webdriver With PHPUnit Automation test for Joomla CMS!
Puneet Kala
 
Rapid Prototyping with Solr
Rapid Prototyping with SolrRapid Prototyping with Solr
Rapid Prototyping with Solr
Erik Hatcher
 
Using Thinking Sphinx with rails
Using Thinking Sphinx with railsUsing Thinking Sphinx with rails
Using Thinking Sphinx with rails
Rishav Dixit
 
iOS Swift application architecture
iOS Swift application architectureiOS Swift application architecture
iOS Swift application architecture
Romain Rochegude
 
Android search
Android searchAndroid search
Android search
Krazy Koder
 
Android search
Android searchAndroid search
Android search
Krazy Koder
 

Similar to Introduction to ElasticSearch (20)

Selenium & PHPUnit made easy with Steward (Berlin, April 2017)
Selenium & PHPUnit made easy with Steward (Berlin, April 2017)Selenium & PHPUnit made easy with Steward (Berlin, April 2017)
Selenium & PHPUnit made easy with Steward (Berlin, April 2017)
 
Introduction to Elasticsearch with basics of Lucene
Introduction to Elasticsearch with basics of LuceneIntroduction to Elasticsearch with basics of Lucene
Introduction to Elasticsearch with basics of Lucene
 
Apache Lucene: Searching the Web and Everything Else (Jazoon07)
Apache Lucene: Searching the Web and Everything Else (Jazoon07)Apache Lucene: Searching the Web and Everything Else (Jazoon07)
Apache Lucene: Searching the Web and Everything Else (Jazoon07)
 
Apache Lucene Searching The Web
Apache Lucene Searching The WebApache Lucene Searching The Web
Apache Lucene Searching The Web
 
Mastering Test Automation: How To Use Selenium Successfully
Mastering Test Automation: How To Use Selenium SuccessfullyMastering Test Automation: How To Use Selenium Successfully
Mastering Test Automation: How To Use Selenium Successfully
 
Prototyping applications with heroku and elasticsearch
 Prototyping applications with heroku and elasticsearch Prototyping applications with heroku and elasticsearch
Prototyping applications with heroku and elasticsearch
 
SCR Annotations for Fun and Profit
SCR Annotations for Fun and ProfitSCR Annotations for Fun and Profit
SCR Annotations for Fun and Profit
 
Search Engine Capabilities - Apache Solr(Lucene)
Search Engine Capabilities - Apache Solr(Lucene)Search Engine Capabilities - Apache Solr(Lucene)
Search Engine Capabilities - Apache Solr(Lucene)
 
[2D1]Elasticsearch 성능 최적화
[2D1]Elasticsearch 성능 최적화[2D1]Elasticsearch 성능 최적화
[2D1]Elasticsearch 성능 최적화
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...
 
[2 d1] elasticsearch 성능 최적화
[2 d1] elasticsearch 성능 최적화[2 d1] elasticsearch 성능 최적화
[2 d1] elasticsearch 성능 최적화
 
Tips for Angular Applications
Tips for Angular ApplicationsTips for Angular Applications
Tips for Angular Applications
 
Adding High Performance Search to your Grails App
Adding High Performance Search to your Grails AppAdding High Performance Search to your Grails App
Adding High Performance Search to your Grails App
 
Ako prepojiť aplikáciu s Elasticsearch
Ako prepojiť aplikáciu s ElasticsearchAko prepojiť aplikáciu s Elasticsearch
Ako prepojiť aplikáciu s Elasticsearch
 
Selenium-Webdriver With PHPUnit Automation test for Joomla CMS!
Selenium-Webdriver With PHPUnit Automation test for Joomla CMS!Selenium-Webdriver With PHPUnit Automation test for Joomla CMS!
Selenium-Webdriver With PHPUnit Automation test for Joomla CMS!
 
Rapid Prototyping with Solr
Rapid Prototyping with SolrRapid Prototyping with Solr
Rapid Prototyping with Solr
 
Using Thinking Sphinx with rails
Using Thinking Sphinx with railsUsing Thinking Sphinx with rails
Using Thinking Sphinx with rails
 
iOS Swift application architecture
iOS Swift application architectureiOS Swift application architecture
iOS Swift application architecture
 
Android search
Android searchAndroid search
Android search
 
Android search
Android searchAndroid search
Android search
 

Recently uploaded

Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
ssuserfac0301
 
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
Edge AI and Vision Alliance
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
DanBrown980551
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
saastr
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
Chart Kalyan
 
JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
Miro Wengner
 
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
Jason Yip
 
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
Fwdays
 
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and BioinformaticiansBiomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Neo4j
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
Antonios Katsarakis
 
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-EfficiencyFreshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
ScyllaDB
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota
Fwdays
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
Tatiana Kojar
 
Y-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PPY-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PP
c5vrf27qcz
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
Principle of conventional tomography-Bibash Shahi ppt..pptx
Principle of conventional tomography-Bibash Shahi ppt..pptxPrinciple of conventional tomography-Bibash Shahi ppt..pptx
Principle of conventional tomography-Bibash Shahi ppt..pptx
BibashShahi
 

Recently uploaded (20)

Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
 
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
 
JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
 
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
 
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
 
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and BioinformaticiansBiomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
 
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-EfficiencyFreshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
 
Y-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PPY-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PP
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
Principle of conventional tomography-Bibash Shahi ppt..pptx
Principle of conventional tomography-Bibash Shahi ppt..pptxPrinciple of conventional tomography-Bibash Shahi ppt..pptx
Principle of conventional tomography-Bibash Shahi ppt..pptx
 

Introduction to ElasticSearch

  • 2. History  Shay Baron   Compass in 2004 ElasticSearch in 2010    Written in Java Cross-platform Distributed
  • 4. Features  Distributed and Highly Available Search Engine      Each index is fully sharded with a configurable number of shards Each shard can have one or more replicas Read / Search operations performed on either one of the replica shard Multi Tenant with Multi Types Various set of APIs
  • 5. Features  Document Oriented No need for upfront schema definition    (Near) Real Time Search Per-Operation Persistence  Single document level operations are atomic, consistent, isolated and durable
  • 6. Features  Built on top of Lucene     Each shard is a fully functional Lucene index All the power of Lucene easily exposed through simple configuration / plugins Independent of file format Open Source under Apache 2 License
  • 7. Setting Up Elastic Search  Download ElasticSearch (CentOS) sudo yum install elasticsearch   Start ElasticSearch Server  elasticsearch -f -D es.config=/usr/local/Cellar/elasticsearch/0.18.5/config/elasticsear ch.yml
  • 8. Setting up ElasticSearch w/ Ruby   The ElasticSearch is not ruby specific so 'tire' gem helps ruby based projects to communicate with ElasticSearch 'tire' gem https://github.com/karmi/retire   We then need to require following libraries   require 'rubygems' require 'tire'
  • 9. Indexing Records   Indexing includes both “Create” and “Update” in CRUD. In order to make index request for new JSON object, we pass the following URL  http://localhost:<port>/<index>/<type>/[<id>].
  • 10. Indexing   Creating an index curl -XPUT "http://localhost:9200/movies/movie/1" -d' {  "title": "The Godfather", "director": "Francis Ford Coppola", "year": 1972     }'
  • 11. Indexing Response  After executing the request, we get the following response {        } “ok”: “_index”: “_type”: “_id”: “_version”: true, “movies”, “movie”, “1”, 1
  • 12. Retrieving Index  Retrieving the index  curl -XGET "http://localhost:9200/movies/movie/1" -d''
  • 14. Delete Index  Deleting the index  curl -XDELETE "http://localhost:9200/movies/movie/1" -d''
  • 15. Demo Application  Demo Application by karmi  $ rails new searchapp -m https://raw.github.com/karmi/tire/master/exam les/railsapplication-template.rb
  • 16. Demo: Search App - Model  Model include Tire::Model::Search include Tire::Model::Callbacks     These two 'tire' models allow your rails application to use tire gem for searching purposes
  • 17. Demo: Search App - Controller  Controller   @articles = Article.tire.search params[:query] This line in your search method helps to search using tire gem
  • 18. Demo: Search App - View  View     <%= form_tag search_articles_path, method: :get do %> <%= text_field_tag :q, params[:query] %> <%= submit_tag :search %> <% end %>
  • 19. Demo: Search App - Index  Create an index          Tire.index 'articles' do delete create store :title => 'One', :tags => ['ruby'] store :title => 'Two', :tags => ['ruby', 'python'] store :title => 'Three', :tags => ['java'] store :title => 'Four', :tags => ['ruby', 'php'] refresh end
  • 20. Demo: Search App - Index  For custom mapping Tire.index 'articles' do  delete create :mappings => { :article => { :properties => { :id => { :type => 'string', :index => 'not_analyzed', :include_in_all => false }, :title => { :type => 'string', :boost => 2.0, :analyzer => 'snowball' }, :tags => { :type => 'string', :analyzer => 'keyword' }, :content => { :type => 'string', :analyzer => 'snowball' } } }           }   end
  • 21. Demo: Search App – Bulk Indexing   For indexing large amount of data articles = [       { :id => '1', :type => 'article', :title => 'one', :tags => ['ruby'] }, { :id => '2', :type => 'article', :title => 'two', :tags => ['ruby', 'python'] }, { :id => '3', :type => 'article', :title => 'three', :tags => ['java'] }, { :id => '4', :type => 'article', :title => 'four', :tags => ['ruby', 'php'] } ] Use Import    Tire.index 'articles' do import articles end
  • 22. Displaying Facets  For displaying facets s.results.facets['global-tags']['terms'].each do |f|     puts "#{f['term'].ljust(10)} #{f['count']}" end Output     ruby python php java 3 1 1 1