SlideShare une entreprise Scribd logo
1  sur  23
Télécharger pour lire hors ligne
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

Contenu connexe

Similaire à ITB2019 Easy ElasticSearch with cbElasticSearch - Jon Clausen

Similaire à ITB2019 Easy ElasticSearch with cbElasticSearch - Jon Clausen (20)

Gab document db scaling database
Gab   document db scaling databaseGab   document db scaling database
Gab document db scaling database
 
Powering Systems of Engagement
Powering Systems of EngagementPowering Systems of Engagement
Powering Systems of Engagement
 
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 .local Chicago 2019: Still Haven't Found What You Are Looking For? Us...
 
MongoDB 3.2 - Analytics
MongoDB 3.2  - AnalyticsMongoDB 3.2  - Analytics
MongoDB 3.2 - Analytics
 
Querying NoSQL with SQL: HAVING Your JSON Cake and SELECTing it too
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
 
Big Data Analytics 1: Driving Personalized Experiences Using Customer Profiles
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
 
Query in Couchbase. N1QL: SQL for JSON
Query in Couchbase.  N1QL: SQL for JSONQuery in Couchbase.  N1QL: SQL for JSON
Query in Couchbase. N1QL: SQL for JSON
 
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 ...
Stratio: Geospatial and bitemporal search in Cassandra with pluggable Lucene ...
 
Geospatial and bitemporal search in cassandra with pluggable lucene index
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
Mongo Web Apps: OSCON 2011Mongo Web Apps: OSCON 2011
Mongo Web Apps: OSCON 2011
 
N1QL+GSI: Language and Performance Improvements in Couchbase 5.0 and 5.5
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
 
LJC Conference 2014 Cassandra for Java Developers
LJC Conference 2014 Cassandra for Java DevelopersLJC Conference 2014 Cassandra for Java Developers
LJC Conference 2014 Cassandra for Java Developers
 
How to leverage what's new in MongoDB 3.6
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
 
Utilizing Arrays: Modeling, Querying and Indexing
Utilizing Arrays: Modeling, Querying and IndexingUtilizing Arrays: Modeling, Querying and Indexing
Utilizing Arrays: Modeling, Querying and Indexing
 
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...
0 to 60 with AWS AppSync: Rapid Development Techniques for Mobile APIs (MOB32...
 
Elasticsearch: You know, for search! and more!
Elasticsearch: You know, for search! and more!Elasticsearch: You know, for search! and more!
Elasticsearch: You know, for search! and more!
 
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.
Deep dive into N1QL: SQL for JSON: Internals and power features.
 
Systems of engagement
Systems of engagementSystems of engagement
Systems of engagement
 
MongoDB Stich Overview
MongoDB Stich OverviewMongoDB Stich Overview
MongoDB Stich Overview
 
Building a Real-Time Geospatial-Aware Recommendation Engine
 Building a Real-Time Geospatial-Aware Recommendation Engine Building a Real-Time Geospatial-Aware Recommendation Engine
Building a Real-Time Geospatial-Aware Recommendation Engine
 

Plus de Ortus Solutions, Corp

Plus de Ortus Solutions, Corp (20)

BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
Ortus Government.pdf
Ortus Government.pdfOrtus Government.pdf
Ortus Government.pdf
 
Luis Majano The Battlefield ORM
Luis Majano The Battlefield ORMLuis Majano The Battlefield ORM
Luis Majano The Battlefield ORM
 
Brad Wood - CommandBox CLI
Brad Wood - CommandBox CLI Brad Wood - CommandBox CLI
Brad Wood - CommandBox CLI
 
Secure your Secrets and Settings in ColdFusion
Secure your Secrets and Settings in ColdFusionSecure your Secrets and Settings in ColdFusion
Secure your Secrets and Settings in ColdFusion
 
Daniel Garcia ContentBox: CFSummit 2023
Daniel Garcia ContentBox: CFSummit 2023Daniel Garcia ContentBox: CFSummit 2023
Daniel Garcia ContentBox: CFSummit 2023
 
ITB_2023_Human-Friendly_Scheduled_Tasks_Giancarlo_Gomez.pdf
ITB_2023_Human-Friendly_Scheduled_Tasks_Giancarlo_Gomez.pdfITB_2023_Human-Friendly_Scheduled_Tasks_Giancarlo_Gomez.pdf
ITB_2023_Human-Friendly_Scheduled_Tasks_Giancarlo_Gomez.pdf
 
ITB_2023_CommandBox_Multi-Server_-_Brad_Wood.pdf
ITB_2023_CommandBox_Multi-Server_-_Brad_Wood.pdfITB_2023_CommandBox_Multi-Server_-_Brad_Wood.pdf
ITB_2023_CommandBox_Multi-Server_-_Brad_Wood.pdf
 
ITB_2023_The_Many_Layers_of_OAuth_Keith_Casey_.pdf
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_.pdf
 
ITB_2023_Relationships_are_Hard_Data_modeling_with_NoSQL_Curt_Gratz.pdf
ITB_2023_Relationships_are_Hard_Data_modeling_with_NoSQL_Curt_Gratz.pdfITB_2023_Relationships_are_Hard_Data_modeling_with_NoSQL_Curt_Gratz.pdf
ITB_2023_Relationships_are_Hard_Data_modeling_with_NoSQL_Curt_Gratz.pdf
 
ITB_2023_Extend_your_contentbox_apps_with_custom_modules_Javier_Quintero.pdf
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
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_CBWire_v3_Grant_Copley.pdf
ITB_2023_CBWire_v3_Grant_Copley.pdfITB_2023_CBWire_v3_Grant_Copley.pdf
ITB_2023_CBWire_v3_Grant_Copley.pdf
 
ITB_2023_Practical_AI_with_OpenAI_-_Grant_Copley_.pdf
ITB_2023_Practical_AI_with_OpenAI_-_Grant_Copley_.pdfITB_2023_Practical_AI_with_OpenAI_-_Grant_Copley_.pdf
ITB_2023_Practical_AI_with_OpenAI_-_Grant_Copley_.pdf
 
ITB_2023_When_Your_Applications_Work_As_a_Team_Nathaniel_Francis.pdf
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
 
ITB_2023_Faster_Apps_That_Wont_Get_Crushed_Brian_Klaas.pdf
ITB_2023_Faster_Apps_That_Wont_Get_Crushed_Brian_Klaas.pdfITB_2023_Faster_Apps_That_Wont_Get_Crushed_Brian_Klaas.pdf
ITB_2023_Faster_Apps_That_Wont_Get_Crushed_Brian_Klaas.pdf
 
ITB_2023_Chatgpt_Box_Scott_Steinbeck.pdf
ITB_2023_Chatgpt_Box_Scott_Steinbeck.pdfITB_2023_Chatgpt_Box_Scott_Steinbeck.pdf
ITB_2023_Chatgpt_Box_Scott_Steinbeck.pdf
 
ITB_2023_CommandBox_Task_Runners_Brad_Wood.pdf
ITB_2023_CommandBox_Task_Runners_Brad_Wood.pdfITB_2023_CommandBox_Task_Runners_Brad_Wood.pdf
ITB_2023_CommandBox_Task_Runners_Brad_Wood.pdf
 
ITB_2023_Create_as_many_web_sites_or_web_apps_as_you_want_George_Murphy.pdf
ITB_2023_Create_as_many_web_sites_or_web_apps_as_you_want_George_Murphy.pdfITB_2023_Create_as_many_web_sites_or_web_apps_as_you_want_George_Murphy.pdf
ITB_2023_Create_as_many_web_sites_or_web_apps_as_you_want_George_Murphy.pdf
 
ITB2023 Developing for Performance - Denard Springle.pdf
ITB2023 Developing for Performance - Denard Springle.pdfITB2023 Developing for Performance - Denard Springle.pdf
ITB2023 Developing for Performance - Denard Springle.pdf
 

Dernier

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Dernier (20)

Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 

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