Recently

Categories
By Topic
Categories
By Audience

Theme and CSS
IT Support
Hosting and comments

Tuesday, October 01, 2002

Fine-tuning Google Site Search

More tips from RFB on fine-tuning the Google search box.

Sample code for focused custom Google search. The site search feature of Google's free custom search offering works by default only for sites whose addresses are root-level URLs (so, for example, you can use it out-of-the-box to search jrobb.userland.com or blogs.salon.com but not blogs.salon.com/0001111/).

With the help of Ian Landsman and a few other readers over the weekend, I've come up with code that produces a custom Google search of just this blog. I've in fact replaced my calendar with it (well, I've moved the calendar to the bottom of my masthead column anyway, on the theory that robots may still find it useful).

I want to offer the code to anyone to copy and tweak, but I've learned that posting code (even escaped-out code) to a blog entry tends to upset news aggregators, so instead I've written up the learning process with a few code samples as a story. [ Source:  Radio Free Blogistan]



Google Search Specifics

Repost: More details on how to force the Google search to stay within a given URL.

One solution to Google site search. Have I mentioned lately that I love the Internet? Cast a question on the waters and the answer (or an answer) generally comes back within 24 hours.

Ian Landsman sent me a solution in the comments to my previous post. I'd paste the code in here but even when escaped out it will cause problems for at least some aggregators, so look at the comment if you're interested.

Basically, Ian's solution passes the inurl:0001111 specification that limits the search to just my site on this server, including it in the query as a hidden text value by including name="q"

The only drawback I can see to this solution is that, by avoiding the custom Google search, it doesn't permit cobranding (not that big a deal to me as a private individual but perhaps an issue for more commercial enterprises) and it doesn't offer site-specific search option on the results page.

I'm playing around with a hybrid solution on an experimental page (experimental meaning undesigned, no navigation, etc.). Basically, it involves using as much of the custom code as possible but still trying to pass the hidden text values per Ian's solution. It seems to work just fine, but I'll keep banging away at it for a while to see if I've screwed it up.

If it does work, I'm going to replace my calendar with a search box and then probably write up a story with the code so it won't break aggregators but so I can distribute it to anyone who isn't blogging from the root of their domain.

(This entry x-posted to knowhow category because making blogs—or k-logs alike—searchable addresses a key question regarding the usefulness of logging as a KM or knowledge sharing instrument.) [ Source:  Radio Free Blogistan]



Search this site:
October 2002
Sun Mon Tue Wed Thu Fri Sat
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    
Sep   Nov

Contact

Terry W. Frazier
1041 Honey Creek Road
Suite 281
Conyers, GA 30013
 
770-918-1937 office
404-822-6014 mobile

  Click here to send an email to the editor of this weblog.     blogchat: If diamond is GREEN click to chat

Wide.angle
K.log
Un.commontary
Tech.knowlogy
Legal
Body.politic
Books
Radio.active
Design.graph
Ref.useful
Atlanta.area