Download - CBDW2-14Advance Website Search Techniques using Apache Solr & Google CSE

Transcript
Page 1: CBDW2-14Advance Website Search Techniques using Apache Solr & Google CSE

Solr & Google CSEADVANCE WEB SEARCH TECHNIQUES

Page 2: CBDW2-14Advance Website Search Techniques using Apache Solr & Google CSE

About Me Jeremy DeYoung

Father of 3 kids

Entrepreneur

Founding Partner of Firearms For Sale & solo-developer

Working in ColdFusion since ‘97

And loving ColdBox since its verson 2.x days!

Page 3: CBDW2-14Advance Website Search Techniques using Apache Solr & Google CSE

Goals of the Presentation Overview of my Evolution of Website Search

◦ SQL ◦ CFSearch◦ Third-party client-side plugins

Overview Integration Google Custom Search◦ How to Sort, Filter, Bias using Custom Meta Data

Overview Integration of Apache Solr◦ Total Customization of Search◦ Faceting, grouping, search+browse+filter possible

Next, the good stuff… examples code & live demo of how it works

And finally, if we have time, a Q&A

Page 4: CBDW2-14Advance Website Search Techniques using Apache Solr & Google CSE

Early Days of Searching SELECT * FROM [table] WHERE [field] LIKE ‘%#searchterm#%’

CFCollection, CFIndex, & CFSearch

<cfquery name="MyQuery"> select pageID, PageText, PageDescription from MyPages</cfquery>

<cfindex collection= " MyCollection " action = "update" type= "custom" body= " PageText,PageDescription " query= " MyQuery " key= "pageID ">

<cfsearch name="searchResults" collection=" MyCollection" criteria=" fetch me a stick ">

<cfdump var="#searchResults#">

Page 5: CBDW2-14Advance Website Search Techniques using Apache Solr & Google CSE

Google Custom Search Engine The power of Google Search directly integrated within your website

Searching, Filtering, Bias, Sorting are possible

Integrate with XML/JSON or Javascript/Client Side script

The limitations is that you can’t group or facet your data and time to index is all in google’s hands.

In my opinion Google CSE is built to search non-product websites i.e. blogs, content, etc… but storefront websites work however very limited

Page 6: CBDW2-14Advance Website Search Techniques using Apache Solr & Google CSE

Solr Faceting of any field, range, both static and dynamic variable ranges

Filter of any search query both word specific & phrase specific boosting

Entire Field boosting i.e. categories, attributes, manufacturers, etc…

Pre-filtering on data import – 30+ prebuilt filters – powerful data import options

Pre-query filters

Replication, distribution, & clustering with SolrCloud support in the most recent version

Page 7: CBDW2-14Advance Website Search Techniques using Apache Solr & Google CSE

My Solr Limitations Limitations at the moment is the pre-term filtering must be done before Solr is involved i.e. via ColdFusion or other language. Version 5 will offer Javascript pre-term filtering & modification within Solr without the need of an interception. i.e. you can expose solr directly to the web.

For Example take the search phrase ::

sig 9mm 1911 pistol

And turn it into

sig +manufactuerID:888 9mm^10 1911 pistol +categoryID:2

Currently the only option I’ve found is to handle this thru code before solr is involved.

Page 8: CBDW2-14Advance Website Search Techniques using Apache Solr & Google CSE

And now onto Code!

Page 9: CBDW2-14Advance Website Search Techniques using Apache Solr & Google CSE