Sorting on custom fields

It seems there’s no obvious way to do a ticket search with the sort
order determined by a custom field. I’ve created a custom ticket
attribute that I’d like to sort things by when doing a search, but it
never shows up in the “sort results by” drop-down. Does anyone know of
an easy way to change this?