def sort(opts = {})
      return [] if not distkey
      
      opts[:by] = sortables[opts[:by]]  if opts[:by]

      if opts[:start] && opts[:limit]
        opts[:limit] = [opts[:start], opts[:limit]]
      end

      objects(distkey.sort(opts))
    end
def sort(opts = {})
      return [] if not distkey
      
      opts[:by] = sortables[opts[:by]]  if opts[:by]

      if opts[:start] && opts[:limit]
        opts[:limit] = [opts[:start], opts[:limit]]
      end

      objects(distkey.sort(opts))
    end
Gives the ability to sort the search results via a `sortable` field
 in your index.

 @example

   Lunar.index Gadget do |i|
     i.id 1001
     i.text :title, "Apple Macbook Pro"
     i.sortable :votes, 10
   end

   Lunar.index Gadget do |i|
     i.id 1002
     i.text :title, "Apple iPad"
     i.sortable :votes, 50
   end

   results = Lunar.search(Gadget, :q => "apple")
   sorted  = results.sort(:by => :votes, :order => "DESC")

   sorted == [Gadget[1002], Gadget[1001]]
   # => true

 @param [Hash] opts the various opts to pass to Redis SORT command.
 @option opts [#to_s] :by the field in the namespace you want to sort by.
 @option opts [#to_s] :order the direction you want to sort i.e. ASC DESC ALPHA
 @option opts [Array] :limit offset and max results to return.

 @return [Array] Array of objects as defined by the `finder`.
 @see http://code.google.com/p/redis/wiki/SortCommand