Improved search queries

Piece by piece we’re trying to improve our google search tool. We can finally announce a few features we think will please you.

Simpler search queries

It’s been a major bugbear that we’ve had to include the long and unfriendly google account codes in our search forms and query strings, however, we’re now inserting these at the server level, so that you  don’t have to do it in your code. This has two effects:

  1. You can create simple url searches like this
    http://search.unimelb.edu.au/?q=economical
    which not only look better, they make sense, are easier to insert and maintain and don’t break in emails.
  2. …and following on from that is simpler search forms. There is an updated include file that you can add to your existing site, and all the template downloads have been amended. It will have no effect at all apart from nice clean code – but what maintainer doesn’t like that?

Smarter search queries

Search by site is commonly requested, happy to say, it now seems to work! You could always manually add something like site:lib.unimelb.edu.au to your search query and it would restrict to that url, but that’s not much help if you want to create a site search form. To achieve this, simply add this variable into your search form:  <input type="hidden" name="as_sitesearch" value="lib.unimelb.edu.au" /> substituting your own domain/path in the value. Will no longer work when the search engine changes in mid 2013. Whatever you do, DONT use this to turn the search box at the top of your page into a site-restricted search, that will confuse your user – put it in a different place and clearly label it as a ‘your-site search’.

A similar approach can be used to search for particular filetypes. Not a common request, but just to place it on the record, inserting this field:  <input type="hidden" name="as_filetype" value="pdf" />will yield results of pdf files only again, will not work in the updated search engine.