def commit_update(self, hash_map):
    """ Commits field/value changes to SOLR.

    Args:
      hash_map: A dictionary to send to SOLR.
    Raises:
       search_exceptions.InternalError: On failure.
    """
    docs = []
    docs.append(hash_map)
    json_payload = simplejson.dumps(docs)
    solr_url = "http://{0}:{1}/solr/update/json?commit=true".format(
      self._search_location, self.SOLR_SERVER_PORT)
    try:
      req = urllib2.Request(solr_url, data=json_payload)
      req.add_header('Content-Type', 'application/json')
      conn = urllib2.urlopen(req) 
      if conn.getcode() != HTTP_OK:
        logging.error("Got code {0} with URL {1} and payload {2}".format(
        conn.getcode(), solr_url, json_payload))
        raise search_exceptions.InternalError("Bad request sent to SOLR.")
      response = simplejson.load(conn)
      status = response['responseHeader']['status'] 
      logging.debug("Response: {0}".format(response))
    except __HOLE__, exception:
      logging.error("Unable to decode json from SOLR server: {0}".format(
        exception))
      raise search_exceptions.InternalError("Malformed response from SOLR.")

    if status != 0:
      raise search_exceptions.InternalError(
        "SOLR response status of {0}".format(status))
dataset/ETHPy150Open AppScale/appscale/SearchService/solr_interface.py/Solr.commit_update