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




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 21, 2009 at 6:47 PM
Hal Helms - Real World Object Oriented Development, Sarasota - Day Five
@charlie griefer, Thank you.. ... read »
Nov 21, 2009 at 5:15 PM
Using ColdFusion Structures To Remove Duplicate List Values
@Jose Galdamez, Oh heh yeah I didn't paste the whole code. I should have defined the vars -- my bad. It's fixed thou. Thanks. ... read »
Nov 21, 2009 at 4:49 PM
Styling The ColdFusion 8 WriteToBrowser CFImage Output
Great work yet again Ben! Whilst I didn't use this whole code, I copied some of your regex code for a similar problem with the lack of an alt attribute and unescaped ampersands in CFIMAGE for Railo 3 ... read »
Nov 21, 2009 at 1:13 PM
My First ColdFusion Builder Extension - Encrypting And Decrypting CFM / CFC Files
@Ben, Because I am pedantic, I just want to make sure that everyone knows there is absolutely no encryption going on. There is only encoding and obfuscation. The cfencode tool only obfuscates your C ... read »
Nov 21, 2009 at 12:28 PM
Using ColdFusion Structures To Remove Duplicate List Values
@Jody I can't seem to get your code sample to work. If you are still having problems, try this code out and see if it gets you what you wanted. <!--- Comma delimited list with various duplicates ... read »
Nov 21, 2009 at 11:03 AM
Groovy Operator Overloading Does Not Work In The ColdFusion Context
Hi Ben, Thanks for this informative post. Now I am reading ur old posts too ... read »
Nov 21, 2009 at 10:56 AM
HostMySite.com Has The Best ColdFusion Hosting
@Mehul, Yes very nice people, however several downtimes per day which was not acceptable. Hence we had to move out. I am glad you are having good luck with them so far. ... read »