order_by_function field query

I recently added the sort by function capability from Solr 3.1 to one of my projects. I thought I would share my code in case anyone is interested, and to get feedback on my implementation. I'm not sure if this is already being worked on but I couldn't find an open issue for it.

The commit adds an 'order_by_function'  method to the field queries. It allows for any Solr FunctionQuery, nesting, and literal constants.

      #  For example, to order by field1 + (field2*field3):
      #
      #    order_by_function :sum, :field1, [:product, :field2, :field3], :desc
      #
      # ==== Parameters
      # function_name<Symbol>::
      #   the function to run
      # arguments::
      #   the arguments for this function.
      #   - Symbol for a field or function name
      #   - Array for a nested function
      #   - String for a literal constant
      # direction<Symbol>::
      #   :asc or :desc


<!---
@huboard:{"order":99.5}
-->