def update_message(index, attributes, values_by_doc)
      message = Message.new

      message.append_string index
      message.append_array attributes

      message.append_int values_by_doc.length
      values_by_doc.each do |key,values|
        message.append_64bit_int key # document ID
        message.append_ints *values # array of new values (integers)
      end

      message.to_s
    end
def update_message(index, attributes, values_by_doc)
      message = Message.new

      message.append_string index
      message.append_array attributes

      message.append_int values_by_doc.length
      values_by_doc.each do |key,values|
        message.append_64bit_int key # document ID
        message.append_ints *values # array of new values (integers)
      end

      message.to_s
    end
Generation of the message to send to Sphinx to update attributes of a
 document.