Taming Plone's advanced search
In my opinion, Plone's 'livesearch' is one of it's most rewarding features. We recently moved our company intranet to Plone 3, and livesearch makes it very easy to find the information I need quickly.
In contrast, Plone's advanced search form is huge, unwieldy and a little scary. It also creates insanely long URLs, even for simple queries.
For instance, searching for the text "Hello" (using the live search) I get something like this:
http://localhost:8080/plone/search?SearchableText=Hello
However, if I want to search for 'Images' in my site (using the advanced search form) I get something like this:
http://localhost:8080/plone/search?SearchableText=&Title=&Subject_usage%3Aignore_empty=&Description=&created%3Alist%3Adate=1970%2F02%2F01&created_usage=range%3Amin&portal_type%3Alist=Image&Creator=&rs_toggle=%23&review_state%3Alist=external&review_state%3Alist=internal&review_state%3Alist=internally_published&review_state%3Alist=pending&review_state%3Alist=private&review_state%3Alist=visible&review_state%3Alist=published&submit=Search
We recently developed an intranet for one of our customers which involved us adding extra search fields to the advanced search form. The resulting page was a monstrosity, and the URLs which came out of it were often so long that they exceeded the URL length limit for Internet Explorer (!) (see http://support.microsoft.com/kb/208427 ).
From discussing these issues at the Plone Conference in Washington DC last October, the consensus was that the advanced search form needs a rethink. Some good ideas were shared between myself, Geir Baekholt and Danny Bloemendaal about the way forward on this, but that's a subject for another blog post.
To cut an already long story short, we needed an interim solution - a halfway house if you like - as rethinking the advanced search is something we just haven't found the time for yet.
Introducing collective.advancedsearchtamer
Rather than reinventing the wheel just yet, collective.advancedsearchtamer is a mini-product which uses Javascript to tweak the interface to the advanced search form.
When you load the advanced search page, collective.advancedsearchtamer will hide all of the form elements, leaving their labels and description. It then adds a checkbox to each option, allowing you to manually specify which options you want to include in your query.
It looks like this:
With collective.advancedsearchtamer, searching for 'Images' results in the following URL:
http://localhost:8080/plone/search?portal_type%3Alist=Image&submit=Search
... which is a little easier to read, a little less likely to kill Internet Explorer, and a much nicer RSS URL to 'subcribe' to, should you wish.
So there you have it: collective.advancedsearchtamer
It's on pypi now. Hope you find it useful.

