SlideShare a Scribd company logo
Real-time search in Drupal.
Meet Elasticsearch
By Alexei Gorobets
asgorobets
Elasticsearch
Flexible and powerful open source, distributed
real-time search and analytics engine for the
cloud
Elasticsearch
Flexible and powerful open source, distributed
real-time search and analytics engine for the
cloud
RESTful API on top of Lucene library
Why use
Elasticsearch?
● RESTful API
● Open Source
● JSON over HTTP
● based on Lucene
● distributed
● highly available
● schema free
● massively scalable
STOP! Why not SOLR?
● Solr vs Elasticsearch: Features Smackdown
● Detailed overview
● Slideshare presentation by Sematext
● Realtime Search: Solr vs Elasticsearch
Apache Solr vs Elasticsearch
Real-time search in Drupal. Meet Elasticsearch
Setup in 2 steps:
1. Extract the archive
2. > bin/elasticsearch
How to use it?
> curl -XGET localhost:9200/?pretty
> curl -XGET localhost:9200/?pretty
{
"ok" : true,
"status" : 200,
"name" : "Infinity",
"version" : {
"number" : "0.90.1",
"snapshot_build" : false,
"lucene_version" : "4.3"
},
"tagline" : "You Know, for Search"
}
> curl -XGET localhost:9200/?pretty
action
> curl -XGET localhost:9200/?pretty
node + port
> curl -XGET localhost:9200/?pretty
path
> curl -XGET localhost:9200/?pretty
query string
Let's index some data
> PUT /index/type/id
Where?
It's very similar to
database in SQL
> PUT /index/type/id
What?
Table
Content type,
Entity type,
any kind of type you decide
> PUT /index/type/id
Which?
Node ID,
Entity ID,
any kind of serial ID
> PUT /mysite/node/1 -d
{
"nid": "1",
"status": "1",
"title": "Hello elasticsearch",
"body": "First elasticsearch document"
}
> PUT /mysite/node/1 -d
{
"nid": "1",
"status": "1",
"title": "Hello elasticsearch",
"body": "First elasticsearch document"
}
{
"ok":true,
"_index":"mysite",
"_type":"node",
"_id":"1",
"_version":1
}
Let's GET some data
> GET /mysite/node/1
{
"_index" : "mysite",
"_type" : "node",
"_id" : "1",
"_version" : 1,
"exists" : true,
"_source" : {
"nid":"1",
"status":"1",
"title":"Hello elasticsearch",
"body":"First elasticsearch document"
}
> GET /mysite/node/1?fields=title,body
Get specific fields
> GET /mysite/node/1?fields=title,body
Get specific fields
> GET /mysite/node/1/_source
Get source only
Let's UPDATE some data
> PUT /mysite/node/1 -d
{
"status":"0"
}
> PUT /mysite/node/1 -d
{
"ok":true,
"_index":"mysite",
"_type":"node",
"_id":"1",
"_version":2
}
{
"status":"0"
}
UPDATE = DELETE + PUT
Let's DELETE some data
> DELETE /mysite/node/1
> DELETE /mysite/node/1
{
"ok":true,
"found":true,
"_index":"mysite",
"_type":"node",
"_id":"1",
"_version":3
}
Let's SEARCH for something
> GET /_search
> GET /_search
{
"took" : 32,
"timed_out" : false,
"_shards" : {
"total" : 20,
"successful" : 20,
"failed" : 0
},
"hits" : { results... }
}
Let's SEARCH in multiple
indices and types
> GET /index/_search
> GET /index/type/_search
> GET /index1,index2/_search
> GET /myapp_*/type, entity_*/_search
Let's PAGINATE results
> GET /_search?size=10&from=20
size = results per page
from = starting from
Let's search oldschool
> GET /_search?q=title:elasticsearch
> GET /_search?q=nid:60
+title:awesome
+status:1
+created:>1369917354
?q=title:awesome%20%2Bcreated:
>1369917354%20%2Bstatus:1
+title:awesome
+status:1
+created:>1369917354
The ugly encoding =)
Query DSL style
> GET /_search -d
{
"query": {
"match": "awesome"
}
}
> GET /_search -d
{
"query": {
"field" : {
"title" : {
"query" : "+awesome -poor",
"boost" : 2.0,
}
}
}
}
Queries & Filters
Queries & Filters
full text search
relevance score
heavy
not cacheable
exact match
show or hide
lightning fast
cacheable
Combine Filters & Queries
> GET /_search -d
{
"query": {
"filtered": {
"query": {
"match": { "title": "awesome" }
},
"filter": {
"term": { "type": "article" }
}
}
}
}
and Sorting
> GET /_search -d
{
"query": {
"filtered": {
"query": {
"match": { "title": "awesome" }
},
"filter": {
"term": { "type": "article" }
}
}
}
"sort": {"date":"desc"}
}
and Facets
Facets on Amazon
> GET /_search -d
{
"facets": {
"home_team": {
"terms": {
"field": "field_home_team"
}
}
}
}
> GET /_search -d
{
"facets": {
"home_team": {
"terms": {
"field": "field_home_team"
}
}
}
}
Give your facet a name
> GET /_search -d
{
"facets": {
"home_team": {
"terms": {
"field": "field_home_team"
}
}
}
}
Your facet filter can be:
● Terms
● Range
● Histogram
● Date Histogram
● Filter
● Query
● Statistical
● Terms Stats
● Geo Distance
"facets" : {
"home_team" : {
"_type" : "terms",
"missing" : 203,
"total" : 100,
"other" : 42,
"terms" : [ {
"term" : "hou",
"count" : 8
}, {
"term" : "sln",
"count" : 6
}, ...
STOP! I want this in Drupal?
Available modules:
elasticsearch
Search API elasticsearch
Development directions:
1. Search API implementation
2. Field Storage API
Available modules:
elasticsearch
Search API elasticsearch
Field Storage API implementation
Elasticsearch field storage sandbox by Damien Tournoud
Started in July 2011
Field Storage API implementation
Elasticsearch field storage sandbox by Damien Tournoud
Started in July 2011
Elasticsearch EntityFieldQuery sandbox
Commited today! =)
Let's DEMO
Elasticsearch sandbox here:
https://drupal.org/sandbox/asgorobets/2073151
Let the Search be with you
Real-time search in Drupal. Meet Elasticsearch

More Related Content

What's hot (20)

PDF
Monitoramento com ELK - Elasticsearch - Logstash - Kibana
Waldemar Neto
 
PPTX
Elk
Caleb Wang
 
PDF
ELK introduction
Waldemar Neto
 
PDF
ELK, a real case study
Paolo Tonin
 
PDF
Why should I care about REST?
Miguel Sánchez Villafán
 
PDF
kRouter
Kelp Chen
 
PDF
[Srijan Wednesday Webinar] Easy Performance Wins for Your Rails App
Srijan Technologies
 
PDF
Go database/sql
Artem Kovardin
 
PDF
Application Logging With The ELK Stack
benwaine
 
PDF
Elk devops
Ideato
 
PDF
Real-time data analysis using ELK
Jettro Coenradie
 
PDF
Scaling SolrCloud to a Large Number of Collections - Fifth Elephant 2014
Shalin Shekhar Mangar
 
PDF
Contract-driven development with OpenAPI 3 and Vert.x | DevNation Tech Talk
Red Hat Developers
 
PPTX
Scrapy-101
Snehil Verma
 
PDF
Reliable Python REST API (by Volodymyr Hotsyk) - Web Back-End Tech Hangout - ...
Innovecs
 
PDF
2nd Athens Big Data Meetup - 2nd Talk - ElasticSearch: Index and Search Log F...
Athens Big Data
 
PDF
Google App Engine With Java And Groovy
Ken Kousen
 
PPT
Mongo Web Apps: OSCON 2011
rogerbodamer
 
PDF
MySQL in Go - Golang NE July 2015
Mark Hemmings
 
PDF
Selenium&scrapy
Arcangelo Saracino
 
Monitoramento com ELK - Elasticsearch - Logstash - Kibana
Waldemar Neto
 
ELK introduction
Waldemar Neto
 
ELK, a real case study
Paolo Tonin
 
Why should I care about REST?
Miguel Sánchez Villafán
 
kRouter
Kelp Chen
 
[Srijan Wednesday Webinar] Easy Performance Wins for Your Rails App
Srijan Technologies
 
Go database/sql
Artem Kovardin
 
Application Logging With The ELK Stack
benwaine
 
Elk devops
Ideato
 
Real-time data analysis using ELK
Jettro Coenradie
 
Scaling SolrCloud to a Large Number of Collections - Fifth Elephant 2014
Shalin Shekhar Mangar
 
Contract-driven development with OpenAPI 3 and Vert.x | DevNation Tech Talk
Red Hat Developers
 
Scrapy-101
Snehil Verma
 
Reliable Python REST API (by Volodymyr Hotsyk) - Web Back-End Tech Hangout - ...
Innovecs
 
2nd Athens Big Data Meetup - 2nd Talk - ElasticSearch: Index and Search Log F...
Athens Big Data
 
Google App Engine With Java And Groovy
Ken Kousen
 
Mongo Web Apps: OSCON 2011
rogerbodamer
 
MySQL in Go - Golang NE July 2015
Mark Hemmings
 
Selenium&scrapy
Arcangelo Saracino
 

Viewers also liked (7)

PDF
Media management in Drupal @Moldcamp
Alexei Gorobets
 
PDF
Dependency injection in Drupal 8
Alexei Gorobets
 
PDF
Why drupal
Alexei Gorobets
 
PDF
Создание дистрибутивов Drupal. Почему, зачем и как?
Alexei Gorobets
 
PDF
Extending media presentation
Alexei Gorobets
 
PPTX
Migrate in Drupal 8
Alexei Gorobets
 
PDF
Meetup Drupal Paris : Connexion Drupal et Elasticsearch
ALTER WAY
 
Media management in Drupal @Moldcamp
Alexei Gorobets
 
Dependency injection in Drupal 8
Alexei Gorobets
 
Why drupal
Alexei Gorobets
 
Создание дистрибутивов Drupal. Почему, зачем и как?
Alexei Gorobets
 
Extending media presentation
Alexei Gorobets
 
Migrate in Drupal 8
Alexei Gorobets
 
Meetup Drupal Paris : Connexion Drupal et Elasticsearch
ALTER WAY
 
Ad

Similar to Real-time search in Drupal. Meet Elasticsearch (20)

PDF
DRUPAL AND ELASTICSEARCH
DrupalCamp Kyiv
 
PDF
Enhancement of Searching and Analyzing the Document using Elastic Search
IRJET Journal
 
PDF
DrupalANDElasticsearch
Nikolay Ignatov
 
PDF
Introduction to Elasticsearch
Ruslan Zavacky
 
PPTX
Elastic search Walkthrough
Suhel Meman
 
PPTX
An Introduction to Elastic Search.
Jurriaan Persyn
 
PPTX
Elastic pivorak
Pivorak MeetUp
 
PDF
Faster and better search results with Elasticsearch
Enrico Polesel
 
PPTX
Elasticsearch an overview
Amit Juneja
 
PDF
ElasticSearch - index server used as a document database
Robert Lujo
 
PDF
ElasticSearch Introduction
Minh Hoang
 
PPTX
ElasticSearch Basics
Satya Mohapatra
 
PDF
Elasticsearch and Spark
Audible, Inc.
 
PPT
Elk presentation1#3
uzzal basak
 
PDF
Elasticsearch Introduction at BigData meetup
Eric Rodriguez (Hiring in Lex)
 
PPTX
Elasticsearch - DevNexus 2015
Roy Russo
 
PDF
Elasticsearch Quick Introduction
imotov
 
PPSX
Elasticsearch - basics and beyond
Ernesto Reig
 
KEY
Intro to Apache Solr for Drupal
Chris Caple
 
PDF
Hopper Elasticsearch Hackathon
imotov
 
DRUPAL AND ELASTICSEARCH
DrupalCamp Kyiv
 
Enhancement of Searching and Analyzing the Document using Elastic Search
IRJET Journal
 
DrupalANDElasticsearch
Nikolay Ignatov
 
Introduction to Elasticsearch
Ruslan Zavacky
 
Elastic search Walkthrough
Suhel Meman
 
An Introduction to Elastic Search.
Jurriaan Persyn
 
Elastic pivorak
Pivorak MeetUp
 
Faster and better search results with Elasticsearch
Enrico Polesel
 
Elasticsearch an overview
Amit Juneja
 
ElasticSearch - index server used as a document database
Robert Lujo
 
ElasticSearch Introduction
Minh Hoang
 
ElasticSearch Basics
Satya Mohapatra
 
Elasticsearch and Spark
Audible, Inc.
 
Elk presentation1#3
uzzal basak
 
Elasticsearch Introduction at BigData meetup
Eric Rodriguez (Hiring in Lex)
 
Elasticsearch - DevNexus 2015
Roy Russo
 
Elasticsearch Quick Introduction
imotov
 
Elasticsearch - basics and beyond
Ernesto Reig
 
Intro to Apache Solr for Drupal
Chris Caple
 
Hopper Elasticsearch Hackathon
imotov
 
Ad

Recently uploaded (20)

PDF
How to Comply With Saudi Arabia’s National Cybersecurity Regulations.pdf
Bluechip Advanced Technologies
 
PDF
The Future of Product Management in AI ERA.pdf
Alyona Owens
 
PPTX
2025 HackRedCon Cyber Career Paths.pptx Scott Stanton
Scott Stanton
 
PPTX
Paycifi - Programmable Trust_Breakfast_PPTXT
FinTech Belgium
 
PDF
Proactive Server and System Monitoring with FME: Using HTTP and System Caller...
Safe Software
 
PDF
“Scaling i.MX Applications Processors’ Native Edge AI with Discrete AI Accele...
Edge AI and Vision Alliance
 
PDF
Next level data operations using Power Automate magic
Andries den Haan
 
PDF
Simplify Your FME Flow Setup: Fault-Tolerant Deployment Made Easy with Packer...
Safe Software
 
PPTX
Mastering Authorization: Integrating Authentication and Authorization Data in...
Hitachi, Ltd. OSS Solution Center.
 
PPTX
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Poster...
Michele Kryston
 
PPTX
Smarter Governance with AI: What Every Board Needs to Know
OnBoard
 
PDF
99 Bottles of Trust on the Wall — Operational Principles for Trust in Cyber C...
treyka
 
DOCX
Daily Lesson Log MATATAG ICT TEchnology 8
LOIDAALMAZAN3
 
PPTX
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Pitch ...
Michele Kryston
 
PDF
Why aren't you using FME Flow's CPU Time?
Safe Software
 
PDF
Redefining Work in the Age of AI - What to expect? How to prepare? Why it mat...
Malinda Kapuruge
 
PDF
5 Things to Consider When Deploying AI in Your Enterprise
Safe Software
 
PDF
Dev Dives: Accelerating agentic automation with Autopilot for Everyone
UiPathCommunity
 
PDF
Enhancing Environmental Monitoring with Real-Time Data Integration: Leveragin...
Safe Software
 
PDF
Bridging CAD, IBM TRIRIGA & GIS with FME: The Portland Public Schools Case
Safe Software
 
How to Comply With Saudi Arabia’s National Cybersecurity Regulations.pdf
Bluechip Advanced Technologies
 
The Future of Product Management in AI ERA.pdf
Alyona Owens
 
2025 HackRedCon Cyber Career Paths.pptx Scott Stanton
Scott Stanton
 
Paycifi - Programmable Trust_Breakfast_PPTXT
FinTech Belgium
 
Proactive Server and System Monitoring with FME: Using HTTP and System Caller...
Safe Software
 
“Scaling i.MX Applications Processors’ Native Edge AI with Discrete AI Accele...
Edge AI and Vision Alliance
 
Next level data operations using Power Automate magic
Andries den Haan
 
Simplify Your FME Flow Setup: Fault-Tolerant Deployment Made Easy with Packer...
Safe Software
 
Mastering Authorization: Integrating Authentication and Authorization Data in...
Hitachi, Ltd. OSS Solution Center.
 
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Poster...
Michele Kryston
 
Smarter Governance with AI: What Every Board Needs to Know
OnBoard
 
99 Bottles of Trust on the Wall — Operational Principles for Trust in Cyber C...
treyka
 
Daily Lesson Log MATATAG ICT TEchnology 8
LOIDAALMAZAN3
 
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Pitch ...
Michele Kryston
 
Why aren't you using FME Flow's CPU Time?
Safe Software
 
Redefining Work in the Age of AI - What to expect? How to prepare? Why it mat...
Malinda Kapuruge
 
5 Things to Consider When Deploying AI in Your Enterprise
Safe Software
 
Dev Dives: Accelerating agentic automation with Autopilot for Everyone
UiPathCommunity
 
Enhancing Environmental Monitoring with Real-Time Data Integration: Leveragin...
Safe Software
 
Bridging CAD, IBM TRIRIGA & GIS with FME: The Portland Public Schools Case
Safe Software
 

Real-time search in Drupal. Meet Elasticsearch