ITB2019 Easy ElasticSearch with cbElasticSearch - Jon Clausen

Ortus Solutions, Corp
Ortus Solutions, CorpOrtus Solutions, Corp
C B E L A S T I C S E A R C H
M O D E R N I Z E Y O U R S E A R C H
Me: Jon Clausen
Senior Software Developer,

Ortus Solutions
Grand Rapids, Michigan
S E A R C H
E X P E C TAT I O N S :
A N E V O L U T I O N
• As latency in response times
has decreased ( e.g.
broadband speeds ), the
expectations for search
responsiveness has
decreased
• A decade ago, visitors were
willing to wait for their
results. Not anymore. Users
expect pages to load in 2
seconds or less
S E A R C H
E X P E C TAT I O N S :
A N E V O L U T I O N
• Users expect a variety of
filters to meet their
specific search
requirement
• Mobile devices continue
to be game changers and
make search relevancy and
response more critical than
ever
S E A R C H
E X P E C TAT I O N S :
A N E V O L U T I O N
• Abandonment increases
when:
• Search response latency
increases
• Relevancy decreases
• Slow response times are a
double whammy - with
your visitors and for SEO
C F M L S E A R C H
<cfsearch
collection = "collection name"
name = "search name"
category = "category[,category2,...]"
categoryTree = "tree location"
contextBytes = "number of bytes"
contextHighlightBegin = "HTML string"
contextHighlightEnd = "HTML string"
contextPassages = "number of passages"
criteria = "search expression"
maxRows = "number"
orderBy = "rank_order"
previousCriteria = "criteria"
startRow = "row number"
status = ""
suggestions = "suggestion option"
type = "criteria">
C F M L S E A R C H
• Functionally and
programmatically robust
• Reasonable response
times
• Limited in query
complexity and
conditionals
• limited to no aggregation
capabilities
<cfsearch
collection = "collection name"
name = "search name"
category = "category[,category2,...]"
categoryTree = "tree location"
contextBytes = "number of bytes"
contextHighlightBegin = "HTML string"
contextHighlightEnd = "HTML string"
contextPassages = "number of passages"
criteria = "search expression"
maxRows = "number"
orderBy = "rank_order"
previousCriteria = "criteria"
startRow = "row number"
status = ""
suggestions = "suggestion option"
type = "criteria">
E L A S T I C S E A R C H
W H AT I S
E L A S T I C S E A R C H ?
• Open-source, RESTful,
distributed search and
analytics engine built on
Apache Lucene
• Quickly evolved become
the most popular web
application search engine
• Used for log analytics, full-
text search, and
operational intelligence
W H AT I S
E L A S T I C S E A R C H ?
• Free, open source software
which can be run on-
premises or using a variety
of cloud-based providers
• Interacts with applications
through a REST API, using
a JSON-based query DSL
E L A S T I C S E A R C H
B E N E F I T S
• Fast - 10s on SQL vs 10ms
on Elasticsearch
• Intuitive APIs
• Fast Index Updating
• Schema-free JSON
document storage
• Performative on very large
datasets
T H E E L A S T I C S E A R C H D O C U M E N T
{
"vendorCode": "CB",
"VendorName": "Celebrity Cruises",
"destinationCode": "GA",
"shipCode": "XP",
"sailDate": "2018-09-09T00:00:00+00:00",
"region": [
"South America"
],
"partnerShipID": 349,
"APIembarkingPortCode": "BAA",
"lastSerialized": "2018-02-05T04:57:28+00:00",
"shipName": "Celebrity Xpedition",
"embarkingPort": "Baltra Galapagos, Gibraltar",
"regionName": [
"South America"
],
"vendorName": "Celebrity Cruises",
"promotions": {},
"APIembarkingPort": "BALTRA GALAPAGOS",
"vendorID": 20,
"sailingLength": 7,
"vendorShortName": ""
}
T H E E L A S T I C S E A R C H Q U E RY
{
"query": {
"bool": {
"must": [
{
"range": {
"sailDate": {
"gte": "2018-04-27T00:00:00+00:00"
}
}
},
{
"term": {
"vendorCode": "CB"
}
}
]
}
}
}
E L A S T I C S E A R C H G L O S S A RY
• index - like a table in a relational database
• type - now deprecated, but currently in use to
describe the type of document ( e.g. - cruises )
• term - an exact value match in elastic search
• string - ordinary, unstructured text
• field - a key/value storage pair in a document
C B E L A S T I C S E A R C H
A C O L D B O X M O D U L E W I T H A S I M P L E A P I F O R C R E AT I N G ,
I N D E X I N G A N D R E T R I E V I N G E L A S T I C S E A R C H D O C U M E N T S
box install cbelasticsearch



https://github.com/coldbox-modules/cbox-elasticsearch
T H E C B E L A S T I C S E A R C H Q U E RY
var search = getInstance( "SearchBuilder@cbelasticsearch" ).new();

return search.term( "vendorCode", "CB" )
.dateMatch(
name = "startDate",
start = isoFormat( now() )
)
.execute();
T H E C B E L A S T I C S E A R C H Q U E RY
var search = getInstance( "SearchBuilder@cbelasticsearch" ).new();

return search.term( "vendorCode", “CB" )
.match( "region", “South America”, 20 )
.dateMatch(
name = "startDate",
start = "2018-06-01T00:00:00+00:00",
end = “2018-06-30T23:59:59+00:00"
)
.execute();
T H E C B E L A S T I C S E A R C H Q U E RY
return getInstance( "SearchBuilder@cbelasticsearch" )
.aggregation(
"cruiseLines",
{
"terms" : {
"field" : "vendorName",
"size" : 20000,
"order" : { "_term" : "asc" }
},
"aggs" : {
"vendorCode" : {
"terms" : {
"field" : "vendorCode",
"size" : 20000
}
},
"ships" : {
"terms" : {
"field" : "shipName",
"size" : 20000,
"order" : {
"_term" : "asc"
}
}
}
}
}
)
.execute();
T H E C B E L A S T I C S E A R C H Q U E RY
return getInstance( "SearchBuilder@cbelasticsearch" )
.setSource(
{
"includes" : [“id”, “name"],
"excludes" : [*]
}
)
.sort( “name ASC” )

.term( “isActive”, true )

.dateMatch( “createdTime”, isoFormat( minStartDate ) )
.execute();
T H E C B E L A S T I C S E A R C H Q U E RY
return getInstance( "SearchBuilder@cbelasticsearch" )
.multiMatch(

[

“lastName^20”,

“firstName^10”,

“biography”

],

searchText

)
.execute();
G E T T I N G S TA R T E D :
box install cbelasticsearch



https://github.com/coldbox-modules/cbox-elasticsearch
S H O W A N D T E L L
A S U C C E S S S T O RY
Q & A
1 of 23

Recommended

Into The Box 2018 cbelasticsearch by
Into The Box 2018   cbelasticsearchInto The Box 2018   cbelasticsearch
Into The Box 2018 cbelasticsearchOrtus Solutions, Corp
308 views22 slides
Understanding N1QL Optimizer to Tune Queries by
Understanding N1QL Optimizer to Tune QueriesUnderstanding N1QL Optimizer to Tune Queries
Understanding N1QL Optimizer to Tune QueriesKeshav Murthy
336 views50 slides
Elasticmeetup curiosity 20141113 by
Elasticmeetup curiosity 20141113Elasticmeetup curiosity 20141113
Elasticmeetup curiosity 20141113Erwan Pigneul
650 views9 slides
Couchbase Tutorial: Big data Open Source Systems: VLDB2018 by
Couchbase Tutorial: Big data Open Source Systems: VLDB2018Couchbase Tutorial: Big data Open Source Systems: VLDB2018
Couchbase Tutorial: Big data Open Source Systems: VLDB2018Keshav Murthy
667 views241 slides
Mongo db 101 dc group by
Mongo db 101 dc groupMongo db 101 dc group
Mongo db 101 dc groupJohn Ragan
1.5K views41 slides
N1QL: What's new in Couchbase 5.0 by
N1QL: What's new in Couchbase 5.0N1QL: What's new in Couchbase 5.0
N1QL: What's new in Couchbase 5.0Keshav Murthy
1.2K views68 slides

More Related Content

Similar to ITB2019 Easy ElasticSearch with cbElasticSearch - Jon Clausen

Gab document db scaling database by
Gab   document db scaling databaseGab   document db scaling database
Gab document db scaling databaseMUG Perú
150 views70 slides
Powering Systems of Engagement by
Powering Systems of EngagementPowering Systems of Engagement
Powering Systems of EngagementMongoDB
926 views56 slides
MongoDB .local Chicago 2019: Still Haven't Found What You Are Looking For? Us... by
MongoDB .local Chicago 2019: Still Haven't Found What You Are Looking For? Us...MongoDB .local Chicago 2019: Still Haven't Found What You Are Looking For? Us...
MongoDB .local Chicago 2019: Still Haven't Found What You Are Looking For? Us...MongoDB
397 views52 slides
MongoDB 3.2 - Analytics by
MongoDB 3.2  - AnalyticsMongoDB 3.2  - Analytics
MongoDB 3.2 - AnalyticsMassimo Brignoli
460 views88 slides
Querying NoSQL with SQL: HAVING Your JSON Cake and SELECTing it too by
Querying NoSQL with SQL: HAVING Your JSON Cake and SELECTing it tooQuerying NoSQL with SQL: HAVING Your JSON Cake and SELECTing it too
Querying NoSQL with SQL: HAVING Your JSON Cake and SELECTing it tooAll Things Open
359 views59 slides
Big Data Analytics 1: Driving Personalized Experiences Using Customer Profiles by
Big Data Analytics 1: Driving Personalized Experiences Using Customer ProfilesBig Data Analytics 1: Driving Personalized Experiences Using Customer Profiles
Big Data Analytics 1: Driving Personalized Experiences Using Customer ProfilesMongoDB
2.2K views42 slides

Similar to ITB2019 Easy ElasticSearch with cbElasticSearch - Jon Clausen(20)

Gab document db scaling database by MUG Perú
Gab   document db scaling databaseGab   document db scaling database
Gab document db scaling database
MUG Perú150 views
Powering Systems of Engagement by MongoDB
Powering Systems of EngagementPowering Systems of Engagement
Powering Systems of Engagement
MongoDB926 views
MongoDB .local Chicago 2019: Still Haven't Found What You Are Looking For? Us... by MongoDB
MongoDB .local Chicago 2019: Still Haven't Found What You Are Looking For? Us...MongoDB .local Chicago 2019: Still Haven't Found What You Are Looking For? Us...
MongoDB .local Chicago 2019: Still Haven't Found What You Are Looking For? Us...
MongoDB397 views
Querying NoSQL with SQL: HAVING Your JSON Cake and SELECTing it too by All Things Open
Querying NoSQL with SQL: HAVING Your JSON Cake and SELECTing it tooQuerying NoSQL with SQL: HAVING Your JSON Cake and SELECTing it too
Querying NoSQL with SQL: HAVING Your JSON Cake and SELECTing it too
All Things Open359 views
Big Data Analytics 1: Driving Personalized Experiences Using Customer Profiles by MongoDB
Big Data Analytics 1: Driving Personalized Experiences Using Customer ProfilesBig Data Analytics 1: Driving Personalized Experiences Using Customer Profiles
Big Data Analytics 1: Driving Personalized Experiences Using Customer Profiles
MongoDB2.2K views
Query in Couchbase. N1QL: SQL for JSON by Keshav Murthy
Query in Couchbase.  N1QL: SQL for JSONQuery in Couchbase.  N1QL: SQL for JSON
Query in Couchbase. N1QL: SQL for JSON
Keshav Murthy3.9K views
Stratio: Geospatial and bitemporal search in Cassandra with pluggable Lucene ... by DataStax Academy
Stratio: Geospatial and bitemporal search in Cassandra with pluggable Lucene ...Stratio: Geospatial and bitemporal search in Cassandra with pluggable Lucene ...
Stratio: Geospatial and bitemporal search in Cassandra with pluggable Lucene ...
DataStax Academy3.6K views
Geospatial and bitemporal search in cassandra with pluggable lucene index by Andrés de la Peña
Geospatial and bitemporal search in cassandra with pluggable lucene indexGeospatial and bitemporal search in cassandra with pluggable lucene index
Geospatial and bitemporal search in cassandra with pluggable lucene index
Mongo Web Apps: OSCON 2011 by rogerbodamer
Mongo Web Apps: OSCON 2011Mongo Web Apps: OSCON 2011
Mongo Web Apps: OSCON 2011
rogerbodamer14.8K views
N1QL+GSI: Language and Performance Improvements in Couchbase 5.0 and 5.5 by Keshav Murthy
N1QL+GSI: Language and Performance Improvements in Couchbase 5.0 and 5.5N1QL+GSI: Language and Performance Improvements in Couchbase 5.0 and 5.5
N1QL+GSI: Language and Performance Improvements in Couchbase 5.0 and 5.5
Keshav Murthy371 views
LJC Conference 2014 Cassandra for Java Developers by Christopher Batey
LJC Conference 2014 Cassandra for Java DevelopersLJC Conference 2014 Cassandra for Java Developers
LJC Conference 2014 Cassandra for Java Developers
Christopher Batey2.9K views
How to leverage what's new in MongoDB 3.6 by Maxime Beugnet
How to leverage what's new in MongoDB 3.6How to leverage what's new in MongoDB 3.6
How to leverage what's new in MongoDB 3.6
Maxime Beugnet135 views
Utilizing Arrays: Modeling, Querying and Indexing by Keshav Murthy
Utilizing Arrays: Modeling, Querying and IndexingUtilizing Arrays: Modeling, Querying and Indexing
Utilizing Arrays: Modeling, Querying and Indexing
Keshav Murthy1.2K views
0 to 60 with AWS AppSync: Rapid Development Techniques for Mobile APIs (MOB32... by Amazon Web Services
0 to 60 with AWS AppSync: Rapid Development Techniques for Mobile APIs (MOB32...0 to 60 with AWS AppSync: Rapid Development Techniques for Mobile APIs (MOB32...
0 to 60 with AWS AppSync: Rapid Development Techniques for Mobile APIs (MOB32...
Deep dive into N1QL: SQL for JSON: Internals and power features. by Keshav Murthy
Deep dive into N1QL: SQL for JSON: Internals and power features.Deep dive into N1QL: SQL for JSON: Internals and power features.
Deep dive into N1QL: SQL for JSON: Internals and power features.
Keshav Murthy852 views
MongoDB Stich Overview by MongoDB
MongoDB Stich OverviewMongoDB Stich Overview
MongoDB Stich Overview
MongoDB430 views
Building a Real-Time Geospatial-Aware Recommendation Engine by Amazon Web Services
 Building a Real-Time Geospatial-Aware Recommendation Engine Building a Real-Time Geospatial-Aware Recommendation Engine
Building a Real-Time Geospatial-Aware Recommendation Engine
Amazon Web Services11.3K views

More from Ortus Solutions, Corp

Luis Majano The Battlefield ORM by
Luis Majano The Battlefield ORMLuis Majano The Battlefield ORM
Luis Majano The Battlefield ORMOrtus Solutions, Corp
28 views74 slides
Brad Wood - CommandBox CLI by
Brad Wood - CommandBox CLI Brad Wood - CommandBox CLI
Brad Wood - CommandBox CLI Ortus Solutions, Corp
59 views55 slides
Secure your Secrets and Settings in ColdFusion by
Secure your Secrets and Settings in ColdFusionSecure your Secrets and Settings in ColdFusion
Secure your Secrets and Settings in ColdFusionOrtus Solutions, Corp
73 views97 slides
Daniel Garcia ContentBox: CFSummit 2023 by
Daniel Garcia ContentBox: CFSummit 2023Daniel Garcia ContentBox: CFSummit 2023
Daniel Garcia ContentBox: CFSummit 2023Ortus Solutions, Corp
41 views40 slides
ITB_2023_CommandBox_Multi-Server_-_Brad_Wood.pdf by
ITB_2023_CommandBox_Multi-Server_-_Brad_Wood.pdfITB_2023_CommandBox_Multi-Server_-_Brad_Wood.pdf
ITB_2023_CommandBox_Multi-Server_-_Brad_Wood.pdfOrtus Solutions, Corp
14 views21 slides
ITB_2023_The_Many_Layers_of_OAuth_Keith_Casey_.pdf by
ITB_2023_The_Many_Layers_of_OAuth_Keith_Casey_.pdfITB_2023_The_Many_Layers_of_OAuth_Keith_Casey_.pdf
ITB_2023_The_Many_Layers_of_OAuth_Keith_Casey_.pdfOrtus Solutions, Corp
14 views51 slides

More from Ortus Solutions, Corp(20)

ITB_2023_Extend_your_contentbox_apps_with_custom_modules_Javier_Quintero.pdf by Ortus Solutions, Corp
ITB_2023_Extend_your_contentbox_apps_with_custom_modules_Javier_Quintero.pdfITB_2023_Extend_your_contentbox_apps_with_custom_modules_Javier_Quintero.pdf
ITB_2023_Extend_your_contentbox_apps_with_custom_modules_Javier_Quintero.pdf
ITB_2023_25_Most_Dangerous_Software_Weaknesses_Pete_Freitag.pdf by Ortus Solutions, Corp
ITB_2023_25_Most_Dangerous_Software_Weaknesses_Pete_Freitag.pdfITB_2023_25_Most_Dangerous_Software_Weaknesses_Pete_Freitag.pdf
ITB_2023_25_Most_Dangerous_Software_Weaknesses_Pete_Freitag.pdf
ITB_2023_When_Your_Applications_Work_As_a_Team_Nathaniel_Francis.pdf by Ortus Solutions, Corp
ITB_2023_When_Your_Applications_Work_As_a_Team_Nathaniel_Francis.pdfITB_2023_When_Your_Applications_Work_As_a_Team_Nathaniel_Francis.pdf
ITB_2023_When_Your_Applications_Work_As_a_Team_Nathaniel_Francis.pdf

Recently uploaded

Network Source of Truth and Infrastructure as Code revisited by
Network Source of Truth and Infrastructure as Code revisitedNetwork Source of Truth and Infrastructure as Code revisited
Network Source of Truth and Infrastructure as Code revisitedNetwork Automation Forum
42 views45 slides
Why and How CloudStack at weSystems - Stephan Bienek - weSystems by
Why and How CloudStack at weSystems - Stephan Bienek - weSystemsWhy and How CloudStack at weSystems - Stephan Bienek - weSystems
Why and How CloudStack at weSystems - Stephan Bienek - weSystemsShapeBlue
111 views13 slides
Microsoft Power Platform.pptx by
Microsoft Power Platform.pptxMicrosoft Power Platform.pptx
Microsoft Power Platform.pptxUni Systems S.M.S.A.
67 views38 slides
The Power of Heat Decarbonisation Plans in the Built Environment by
The Power of Heat Decarbonisation Plans in the Built EnvironmentThe Power of Heat Decarbonisation Plans in the Built Environment
The Power of Heat Decarbonisation Plans in the Built EnvironmentIES VE
57 views20 slides
Import Export Virtual Machine for KVM Hypervisor - Ayush Pandey - University ... by
Import Export Virtual Machine for KVM Hypervisor - Ayush Pandey - University ...Import Export Virtual Machine for KVM Hypervisor - Ayush Pandey - University ...
Import Export Virtual Machine for KVM Hypervisor - Ayush Pandey - University ...ShapeBlue
34 views17 slides
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f... by
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...TrustArc
77 views29 slides

Recently uploaded(20)

Why and How CloudStack at weSystems - Stephan Bienek - weSystems by ShapeBlue
Why and How CloudStack at weSystems - Stephan Bienek - weSystemsWhy and How CloudStack at weSystems - Stephan Bienek - weSystems
Why and How CloudStack at weSystems - Stephan Bienek - weSystems
ShapeBlue111 views
The Power of Heat Decarbonisation Plans in the Built Environment by IES VE
The Power of Heat Decarbonisation Plans in the Built EnvironmentThe Power of Heat Decarbonisation Plans in the Built Environment
The Power of Heat Decarbonisation Plans in the Built Environment
IES VE57 views
Import Export Virtual Machine for KVM Hypervisor - Ayush Pandey - University ... by ShapeBlue
Import Export Virtual Machine for KVM Hypervisor - Ayush Pandey - University ...Import Export Virtual Machine for KVM Hypervisor - Ayush Pandey - University ...
Import Export Virtual Machine for KVM Hypervisor - Ayush Pandey - University ...
ShapeBlue34 views
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f... by TrustArc
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...
TrustArc77 views
Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P... by ShapeBlue
Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P...Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P...
Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P...
ShapeBlue82 views
Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit... by ShapeBlue
Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit...Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit...
Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit...
ShapeBlue57 views
"Surviving highload with Node.js", Andrii Shumada by Fwdays
"Surviving highload with Node.js", Andrii Shumada "Surviving highload with Node.js", Andrii Shumada
"Surviving highload with Node.js", Andrii Shumada
Fwdays40 views
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLive by Network Automation Forum
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLiveAutomating a World-Class Technology Conference; Behind the Scenes of CiscoLive
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLive
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas... by Bernd Ruecker
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...
Bernd Ruecker50 views
Digital Personal Data Protection (DPDP) Practical Approach For CISOs by Priyanka Aash
Digital Personal Data Protection (DPDP) Practical Approach For CISOsDigital Personal Data Protection (DPDP) Practical Approach For CISOs
Digital Personal Data Protection (DPDP) Practical Approach For CISOs
Priyanka Aash81 views
CloudStack Object Storage - An Introduction - Vladimir Petrov - ShapeBlue by ShapeBlue
CloudStack Object Storage - An Introduction - Vladimir Petrov - ShapeBlueCloudStack Object Storage - An Introduction - Vladimir Petrov - ShapeBlue
CloudStack Object Storage - An Introduction - Vladimir Petrov - ShapeBlue
ShapeBlue46 views
Igniting Next Level Productivity with AI-Infused Data Integration Workflows by Safe Software
Igniting Next Level Productivity with AI-Infused Data Integration Workflows Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Safe Software344 views
State of the Union - Rohit Yadav - Apache CloudStack by ShapeBlue
State of the Union - Rohit Yadav - Apache CloudStackState of the Union - Rohit Yadav - Apache CloudStack
State of the Union - Rohit Yadav - Apache CloudStack
ShapeBlue145 views
Declarative Kubernetes Cluster Deployment with Cloudstack and Cluster API - O... by ShapeBlue
Declarative Kubernetes Cluster Deployment with Cloudstack and Cluster API - O...Declarative Kubernetes Cluster Deployment with Cloudstack and Cluster API - O...
Declarative Kubernetes Cluster Deployment with Cloudstack and Cluster API - O...
ShapeBlue42 views
Keynote Talk: Open Source is Not Dead - Charles Schulz - Vates by ShapeBlue
Keynote Talk: Open Source is Not Dead - Charles Schulz - VatesKeynote Talk: Open Source is Not Dead - Charles Schulz - Vates
Keynote Talk: Open Source is Not Dead - Charles Schulz - Vates
ShapeBlue119 views
Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ... by ShapeBlue
Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ...Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ...
Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ...
ShapeBlue77 views
KVM Security Groups Under the Hood - Wido den Hollander - Your.Online by ShapeBlue
KVM Security Groups Under the Hood - Wido den Hollander - Your.OnlineKVM Security Groups Under the Hood - Wido den Hollander - Your.Online
KVM Security Groups Under the Hood - Wido den Hollander - Your.Online
ShapeBlue102 views

ITB2019 Easy ElasticSearch with cbElasticSearch - Jon Clausen

  • 1. C B E L A S T I C S E A R C H M O D E R N I Z E Y O U R S E A R C H
  • 2. Me: Jon Clausen Senior Software Developer,
 Ortus Solutions Grand Rapids, Michigan
  • 3. S E A R C H E X P E C TAT I O N S : A N E V O L U T I O N • As latency in response times has decreased ( e.g. broadband speeds ), the expectations for search responsiveness has decreased • A decade ago, visitors were willing to wait for their results. Not anymore. Users expect pages to load in 2 seconds or less
  • 4. S E A R C H E X P E C TAT I O N S : A N E V O L U T I O N • Users expect a variety of filters to meet their specific search requirement • Mobile devices continue to be game changers and make search relevancy and response more critical than ever
  • 5. S E A R C H E X P E C TAT I O N S : A N E V O L U T I O N • Abandonment increases when: • Search response latency increases • Relevancy decreases • Slow response times are a double whammy - with your visitors and for SEO
  • 6. C F M L S E A R C H <cfsearch collection = "collection name" name = "search name" category = "category[,category2,...]" categoryTree = "tree location" contextBytes = "number of bytes" contextHighlightBegin = "HTML string" contextHighlightEnd = "HTML string" contextPassages = "number of passages" criteria = "search expression" maxRows = "number" orderBy = "rank_order" previousCriteria = "criteria" startRow = "row number" status = "" suggestions = "suggestion option" type = "criteria">
  • 7. C F M L S E A R C H • Functionally and programmatically robust • Reasonable response times • Limited in query complexity and conditionals • limited to no aggregation capabilities <cfsearch collection = "collection name" name = "search name" category = "category[,category2,...]" categoryTree = "tree location" contextBytes = "number of bytes" contextHighlightBegin = "HTML string" contextHighlightEnd = "HTML string" contextPassages = "number of passages" criteria = "search expression" maxRows = "number" orderBy = "rank_order" previousCriteria = "criteria" startRow = "row number" status = "" suggestions = "suggestion option" type = "criteria">
  • 8. E L A S T I C S E A R C H
  • 9. W H AT I S E L A S T I C S E A R C H ? • Open-source, RESTful, distributed search and analytics engine built on Apache Lucene • Quickly evolved become the most popular web application search engine • Used for log analytics, full- text search, and operational intelligence
  • 10. W H AT I S E L A S T I C S E A R C H ? • Free, open source software which can be run on- premises or using a variety of cloud-based providers • Interacts with applications through a REST API, using a JSON-based query DSL
  • 11. E L A S T I C S E A R C H B E N E F I T S • Fast - 10s on SQL vs 10ms on Elasticsearch • Intuitive APIs • Fast Index Updating • Schema-free JSON document storage • Performative on very large datasets
  • 12. T H E E L A S T I C S E A R C H D O C U M E N T { "vendorCode": "CB", "VendorName": "Celebrity Cruises", "destinationCode": "GA", "shipCode": "XP", "sailDate": "2018-09-09T00:00:00+00:00", "region": [ "South America" ], "partnerShipID": 349, "APIembarkingPortCode": "BAA", "lastSerialized": "2018-02-05T04:57:28+00:00", "shipName": "Celebrity Xpedition", "embarkingPort": "Baltra Galapagos, Gibraltar", "regionName": [ "South America" ], "vendorName": "Celebrity Cruises", "promotions": {}, "APIembarkingPort": "BALTRA GALAPAGOS", "vendorID": 20, "sailingLength": 7, "vendorShortName": "" }
  • 13. T H E E L A S T I C S E A R C H Q U E RY { "query": { "bool": { "must": [ { "range": { "sailDate": { "gte": "2018-04-27T00:00:00+00:00" } } }, { "term": { "vendorCode": "CB" } } ] } } }
  • 14. E L A S T I C S E A R C H G L O S S A RY • index - like a table in a relational database • type - now deprecated, but currently in use to describe the type of document ( e.g. - cruises ) • term - an exact value match in elastic search • string - ordinary, unstructured text • field - a key/value storage pair in a document
  • 15. C B E L A S T I C S E A R C H A C O L D B O X M O D U L E W I T H A S I M P L E A P I F O R C R E AT I N G , I N D E X I N G A N D R E T R I E V I N G E L A S T I C S E A R C H D O C U M E N T S box install cbelasticsearch
 
 https://github.com/coldbox-modules/cbox-elasticsearch
  • 16. T H E C B E L A S T I C S E A R C H Q U E RY var search = getInstance( "SearchBuilder@cbelasticsearch" ).new();
 return search.term( "vendorCode", "CB" ) .dateMatch( name = "startDate", start = isoFormat( now() ) ) .execute();
  • 17. T H E C B E L A S T I C S E A R C H Q U E RY var search = getInstance( "SearchBuilder@cbelasticsearch" ).new();
 return search.term( "vendorCode", “CB" ) .match( "region", “South America”, 20 ) .dateMatch( name = "startDate", start = "2018-06-01T00:00:00+00:00", end = “2018-06-30T23:59:59+00:00" ) .execute();
  • 18. T H E C B E L A S T I C S E A R C H Q U E RY return getInstance( "SearchBuilder@cbelasticsearch" ) .aggregation( "cruiseLines", { "terms" : { "field" : "vendorName", "size" : 20000, "order" : { "_term" : "asc" } }, "aggs" : { "vendorCode" : { "terms" : { "field" : "vendorCode", "size" : 20000 } }, "ships" : { "terms" : { "field" : "shipName", "size" : 20000, "order" : { "_term" : "asc" } } } } } ) .execute();
  • 19. T H E C B E L A S T I C S E A R C H Q U E RY return getInstance( "SearchBuilder@cbelasticsearch" ) .setSource( { "includes" : [“id”, “name"], "excludes" : [*] } ) .sort( “name ASC” )
 .term( “isActive”, true )
 .dateMatch( “createdTime”, isoFormat( minStartDate ) ) .execute();
  • 20. T H E C B E L A S T I C S E A R C H Q U E RY return getInstance( "SearchBuilder@cbelasticsearch" ) .multiMatch(
 [
 “lastName^20”,
 “firstName^10”,
 “biography”
 ],
 searchText
 ) .execute();
  • 21. G E T T I N G S TA R T E D : box install cbelasticsearch
 
 https://github.com/coldbox-modules/cbox-elasticsearch
  • 22. S H O W A N D T E L L A S U C C E S S S T O RY
  • 23. Q & A