Kinky Solutions Now Utilizes Google Custom Search As Site Search

Posted October 4, 2007 at 8:28 AM by Ben Nadel

I can't write site search engines. It has always been a serious Achilles Heel for me. We used to use Verity here at work, but with ColdFusion 7's Verity engine, our machines kept crashing during the seemingly endless indexing process. As such, I have resorted to caveman-like strategies involving SQL LIKE searches (I just cringed a little bit when saying that).

But, I don't want to get into that nightmare - like I need to feel any more inadequate about it. What I wanted to say was that I finally took the time to implement the Google Custom Search technology on my site (you might now notice that my search boxes are Google-branded). Setting up a Google Custom Search box was extremely simple. I started out following a setup tutorial on SEOMoz.org, but that turned out to be slightly dated. The good news is, since that tutorial was written, implementing the Google Custom Search has become even easier (it seems). Now, you don't have to fool around with creating customized result pages - you can actually host the search results directly on your sight using an IFrame.

It's pretty sweet stuff. The Site Search on my site is now finally "usable". I love me some Google.




Reader Comments

Oct 4, 2007 at 9:39 AM // reply »
50 Comments

Cool. I've been looking at doing that as well.

Verity is such a great tool - I wish Adobe would show it some love and made it easier to use - especially the vspider...


Oct 4, 2007 at 9:57 AM // reply »
10,640 Comments

@Jim,

I hear you. I tried to get the Verity Spider to work, but I could not for the life of me figure it out. Certainly, the whole thing seems way too complicated for my caveman brain. And, the idea that anything requires LOCALHOST to be used, that just can't be good.


Oct 4, 2007 at 4:47 PM // reply »
5 Comments

Will you be doing a tutorial? or is it straightforward.


Oct 4, 2007 at 4:58 PM // reply »
10,640 Comments

@Luis,

It's pretty straight forward. Just start out with the SEO Moz tutorial. Now, in the CODE section, you can opt to host the search box AND the results, which basically just requires you to copy-n-paste two different snippets of code.


Oct 5, 2007 at 9:34 AM // reply »
11 Comments

I never liked the Google site searches - it always looked to me that the site owner was lazy.

I read this article last night and was on the fence about implementing it so I talked with my partner this morning and he had the same feelings as I.

Plus it comes along with it's own ads, doesn't look to be styled the way you want it, you won't be able to track search hits and or misses, and it always looks - even though it's only pulling from your site - as if it's gonna pull stuff from somwhere else.


Oct 5, 2007 at 11:12 AM // reply »
10,640 Comments

@Chewbacca,

All valid concerns. You can turn off the ads. As far as the Lazy thing, I agree and disagree. It might look lazy, but I know that it is a much better search than I could build myself. So, until my actual programming abilities are better in this matter, Google Search is clearly the better option.... at point, you have to accept defeat for the greater good.


Oct 5, 2007 at 1:18 PM // reply »
11 Comments

I guess my search is pretty specific for my site, because I have to find establishments,
my article searches are only using fulltext searches.

What I do for establishment searches is order the queries in what is usually relevant:

* Look for the name of the establishment that people are searching for first
(which based on my search logs is near 95%) - and save the IDs from the query.

* Then I do a soundex search on what they typed on the establishment name and
street name - and save these IDs.

* Then I do a keyword search - and save these IDs as well.

* Last I make a list of all of the IDs from the queries - remove duplicates - and
display the results using:

where id in (#PreserveSingleQuotes(ListQualify(IDsList,"'"))#)

and to retain the order of relevance:

order by field(id,#PreserveSingleQuotes(ListQualify(IDsList,"'"))#) ASC

That's for MySQL you coul also use:

ORDER BY (
(
<cfloop index="XindeX" from="1" to="#listlen(IDsList)#">
CASE WHEN ID = '#listgetat( IDsList, XindeX )#'
THEN #XindeX#
ELSE 0
END
) + (
</cfloop>
CASE WHEN ID = '99999999999'
THEN 1
ELSE 0
END
)
) ASC


Oct 5, 2007 at 1:56 PM // reply »
10,640 Comments

@Chewy,

That sounds pretty good. I think one of the problems with a lot of sites is that they are a combination of database driven pages and static pages (as with my site) and I don't know how to handle that. And, on top of that, a lot of my pages run off or SEO URLs that Verity or something else might not be able to handle (or at least not with my limited knowledge).

All to say, I think each situation requires it own tools. And, I have a lot to learn about searching including how to use SQL Server's full text indexing.


Oct 5, 2007 at 5:49 PM // reply »
2 Comments

Ben,

This is great stuff, I already implemented it on two of my sites and my clients love it. Thanks for the tip.


Oct 8, 2007 at 4:55 PM // reply »
2 Comments

Dude...You are so stoneage. :-) This should help you out and your company. Keep em guessing!

This *#(@ rocks!

http://omnifind.ibm.yahoo.net/


Oct 8, 2007 at 5:09 PM // reply »
50 Comments

That is one of the best things about Verity's vspider. It hits your site just like Google does - so it doesn't care if the data is dynamic or static. It's great when/if you can make it work.

The third party sites are nice - but I'd be hesitant to use it on a commercial site. Years ago I spent a lot of time setting up a search through one of these services - only to have them first change their business model and start charging, then they went belly up. Of course it's unlikely Google would do that - but you never know...


Post A Comment

Comment Etiquette: Please do not post spam. Please keep the comments on-topic. Please do not post unrelated questions or large chunks of code. And, above all, please be nice to each other - we're trying to have a good conversation here.

Please review the following issues:

Author Name:


Author Email:

Author Website:

Comment:

Supported HTML tags for formatting: <strong>bold</strong>   <em>italic</em>   <code>code</code>







  • Help Wanted - Find Your Next ColdFusion Job
InVision App - Prototyping Made Beautiful With Prototyping Tools Ben Nadel's Company - Epicenter Consulting Recent Blog Comments
Feb 10, 2012 at 7:21 PM
jQuery AJAX Strips Script Tags And Inserts Them After Parent-Most Elements
Update! Instead of $(eval(options.insertAfter)).after(data['insertData']); I now use: var ajaxNode = document.createElement('span'); var parent = $(eval(options.insertAfter))[0].parentNode; ... read »
Feb 10, 2012 at 6:18 PM
jQuery AJAX Strips Script Tags And Inserts Them After Parent-Most Elements
encountered this same, what I consider, jQuery bug last week. I'm building a site in which I load some content via AJAX. This content contains Linkedin share button placeholders which Linkedin API ne ... read »
Feb 10, 2012 at 11:30 AM
Cross-Origin Resource Sharing (CORS) AJAX Requests Between jQuery And Node.js
After you understand the concepts here, this is an awesome cheatsheet for enabling CORS in just about anything http://enable-cors.org/ ... read »
JM
Feb 10, 2012 at 9:10 AM
My Safari Browser SQLite Database Hello World Example
@Amy, Here is a very good tutorial on how to use JOIN: http://www.sqltutorial.org/sqljoin-innerjoin.aspx ... read »
Feb 10, 2012 at 4:42 AM
Building A Twitter-Inspired RESTful API Architecture In ColdFusion
This is great, very useful Ben. I spotted a small typo in the api.cgm listing: <cfthrow type="Unauthroized" /> Cheers Stefan ... read »
Feb 9, 2012 at 10:35 PM
CFDirectory Filtering Uses Pipe Character For Multiple Filters (Thanks Steve Withington)
I was wondering if there would be a filter you could apply so that you got everything but what you included in the filter. As in show me all docs that are not a .pdf. ... read »
Feb 9, 2012 at 10:29 PM
Learning ColdFusion 9: Application-Specific Data Sources
@Ben, No offence, but if people were really wanting advanced features they would be using a platform like ASP.NET MVC. CFML is so structurally compromised as a tag-based scripting language that ... read »
Feb 9, 2012 at 10:03 PM
Subversion - Cleanup Failed To Process The Following Paths
@Leviaguirre, do you still have problems with this? ... read »