Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Into The Box 2018 cbelasticsearch

47 views

Published on

Jon Clausen

Published in: Software
  • Be the first to comment

  • Be the first to like this

Into The Box 2018 cbelasticsearch

  1. 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. 2. Me: Jon Clausen Team Ortus Member & President of Silo Web Grand Rapids, Michigan
  3. 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. 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. 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. 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. 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. 8. E L A S T I C S E A R C H
  9. 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. 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. 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. 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. 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. 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 • text - ordinary, unstructured text • field - a key/value storage pair in a document
  15. 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. 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 = dateFormat( now(), "yyyy-mm-ddT00:00:00+00:00" ) ) .execute();
  17. 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. 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. 19. G E T T I N G S TA R T E D : box install cbelasticsearch
 
 https://github.com/coldbox-modules/cbox-elasticsearch
  20. 20. S H O W A N D T E L L
  21. 21. H A N D S - O N D E M O N S T R AT I O N
  22. 22. Q & A

×