Kinky Solutions Now Utilizes Google Custom Search As Site Search

Posted October 4, 2007 at 8:28 AM

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.

Post Comment  |  Ask Ben  |  Permalink  |  Print Page



Learning ColdFusion 9 - ColdFusion 9 tutorials, samples, examples, demos

Reader Comments

Oct 4, 2007 at 9:39 AM // reply »
49 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 »
6,516 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 »
6,516 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 »
9 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 »
6,516 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 »
9 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 »
6,516 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 »
49 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 Comment  |  Ask Ben

Recent Blog Comments
Nov 20, 2009 at 11:32 PM
Five Months Without Hungarian Notation And I'm Loving It
I've used headless camel case for years for not only ColdFusion variables, but also SQL tables and fields... pretty much everything involving code. I also subscribe to the "don't abbreviate and clea ... read »
Nov 20, 2009 at 11:00 PM
Five Months Without Hungarian Notation And I'm Loving It
@Marcel, Yeah, I always err on the side of longer but more readable variable names. As for the camel casing of CF methods and the headless camel casing of custom items, I get around this by always ... read »
Nov 20, 2009 at 10:56 PM
Five Months Without Hungarian Notation And I'm Loving It
I use the following and love it: my.namespace.MyComponents.functionMethodsOrUDF() CONSTANT_VALUES_OR_PROPERTIES One thing I always try is to CamelCaseBuiltInColdFusionFunctions() so others can tell ... read »
Nov 20, 2009 at 5:38 PM
Learning ColdFusion 8: CFImage Part I - Reading And Writing Images
Hi Ben, Great article. I've been looking around to see if ColdFusion image engine can programatically create the following "wrap around" effect: http://www.creativepro.com/article/photoshop-s-she ... read »
Nov 20, 2009 at 5:35 PM
Maintaining ColdFusion Sessions Across SMS Text Message Requests Without Cookies
@Dave: I talked to Gert he suggested: <cfhttp method="get" url="http://{some cf website}" result="stuff" addtoken="yes" /> Note the addition of cfhttp attribute addtoken. That should persist y ... read »
Nov 20, 2009 at 5:23 PM
Maintaining ColdFusion Sessions Across SMS Text Message Requests Without Cookies
@Todd, Ahh, gotcha, yeah that makes sense. ... read »
Nov 20, 2009 at 5:17 PM
Maintaining ColdFusion Sessions Across SMS Text Message Requests Without Cookies
Ben, sorry if I didn't make this clear. You can make it work like that if you want, just put <cfset session.foo = 1> (and <cfset application.foo = 1>) in your OnRequestStart() and it reve ... read »