Google Custome Search

Xah Lee, 2009-06-06

Discovered Google Sites, which allows any joe to create a web page. Here's my test page: http://sites.google.com/site/xahlee/xah-lee.

I have a google search box on my home page Xah Lee Web 李杀网. Here is the search box. (view source to see the code)

Google
WebXahLee.org

The box above is from early 2000s, i don't even remember how i got it setup. So, yesterday i was trying to update it, thinking that Google probably has better search box for sites. Then i discovered Google customized search.

However, there are several major problems for me to adopt it.

Besides these bad points for me personally, there are few strong positive points for it, as with most of Google's technology. This search box is not just a inert search box. It is actually a widget, that people can add to their blogs or websites. So, it's a viral distribution model, good for site owner as well as google. This search box actually has its own home page, so that site owners can customize and add contributors and stuff.

On the tech side, Google is really the king of Javascript.


2009-06-11

Addendem

I asked on Google Webmaster forum, for the solution of a simple search box. One Google employee Jonathan Simon provided helpful answer. The answer is Google Custome Search Element. See below:

Loading

I've tried this before... and dismissed it because it inserts search results directly into your page. For some reason i didn't like that, but i don't know what i was thinking. Now i definitely prefer this than all of the above.

There are still some issues.

The search box is too wide. You can set the “style="width:100%;"” to 50%, but then the search result all becomes 50% width too.

This search box works only for accessing a site online. It does not work for web pages that are saved to disk. Namely, if you save a web page containing that search box. Then, later view the page offline and try to search, it does not confine the search to the domain where you orgiinally saved that webpage. This is a problem for some of my projects. For examples, the GNU Emacs Lisp Reference Manual or classical literature works such as The Arabian Nights and Shakespeare, i provide a download version so that readers can read offline. However, that also means the search box will not be functional when used offline.

2009-06
© 2009 by Xah Lee.