You are here. We are not.
October 17, 2006 3:51 PM   Subscribe

Why do some search engines allow you to search blank queries?

Most search engines such as google, yahoo etc. allow you to search for nothing. You can enter no text into the box, then it searches for it. Sometimes the browser is brought to another page (e.g. google goes to a search results page, with just the footer), and sometimes it just refreshes the page.

Why do they do this? If you capture the data it shows a blank query going out to the server. Surely it would be less bandwidth- or cycle- intensive to highlight the error in script or similar. Does Google's API allow blank queries also?

Hardly a life-or-death question, but it's the internets, y'know.
posted by snailer to Computers & Internet (3 answers total)
Adding client-side script to detect this would increase the page size for every single user. It would save bandwidth only for the very rare case where a user presses submit without entering a query. This is almost certainly a net increase in bandwidth.

(When I do a blank search at it just refreshes the page.)
posted by mbrubeck at 4:00 PM on October 17, 2006

Plus they have to be able to handle a blank query anyways, because of browsers with Javascript disabled, and offsite search boxes like the one on this very page.
posted by smackfu at 4:03 PM on October 17, 2006

Best answer: What mbrubeck said- the bandwidth cost of having client side scripting- both in egress and in client page download experience (see: Friendster for the illustration of the opposing principle), when the uploading of a blank character search takes only a few additional URL characters in the GET request, would outweigh the very small number of people who do this.

It's a Keep-It-Simple solution: why bother having excessive client side form verfication or page complexity when you can just deal with that on your servers, at little overall cost?

And it's not like a search is conducted- the front end boxes will scrub the query before it ever enters the system for things like long strings of numbers, excessive numbers of words, invalid characters, and obviously a blank query. The CPU cost of this is minimal, since the text scrubbing of query terms is a minor cost for a few hundred web servers already making and formatting thousands of real queries per second.
posted by hincandenza at 4:24 PM on October 17, 2006

« Older Smack Smack Blam Blam   |   Law and Order UK theme Newer »
This thread is closed to new comments.