def delete_doc(self, doc_id):
    """ Deletes a document by doc ID.

    Args:
      doc_id: A list of document IDs.
    Raises:
      search_exceptions.InternalError on internal errors.
    """
    solr_request = {"delete": {"id": doc_id}}
    solr_url = "http://{0}:{1}/solr/update?commit=true".format(self._search_location,
      self.SOLR_SERVER_PORT)
    logging.debug("SOLR URL: {0}".format(solr_url))
    json_request = simplejson.dumps(solr_request)
    logging.debug("SOLR JSON: {0}".format(json_request))
    try:
      req = urllib2.Request(solr_url, data=json_request)
      req.add_header('Content-Type', 'application/json')
      conn = urllib2.urlopen(req) 
      if conn.getcode() != HTTP_OK:
        raise search_exceptions.InternalError("Malformed response from 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.delete_doc