Break free of cfcollection and cfsearch, along with their server-side limitations, and join the multitudes of Elasticsearch fans, worldwide!
In this session we will introduce you to:
The fundamentals of what Elasticsearch is and what it can do for you
A basic overview of the cbElasticsearch module and its robust indexing and search capabilities
Show you how to build robust, abstract search interfaces for large and/or complex collections
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">
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