def compute_updates(self, index_name, current_fields, doc_fields):
    fields_to_update = []
    for doc_field in doc_fields:
      doc_name = doc_field.name
      found = False
      for current_field in current_fields:
        current_name = current_field['name']
        if current_name == index_name + "_" + doc_name:
          found = True
      if not found:
        new_field = {'name': index_name + "_" + doc_name, 'type':
          doc_field.field_type}
        fields_to_update.append(new_field)
    #TODO add fields to delete also.
    return fields_to_update
Computes the updates needed to update a document in SOLR.
dataset/ETHPy150Open AppScale/appscale/SearchService/solr_interface.py/Solr.compute_updates