def delete(self, query, commit=False):
        """Delete documents matching `query` from Solr, return (URL, status)"""
        params = {}
        if commit:
            params['commit'] = 'true'
        url = self.url + '/update?' + urllib.urlencode(params)
        request = urllib2.Request(url)
        request.add_header('Content-Type', 'text/xml; charset=utf-8')
        request.add_data('<delete><query>{0}</query></delete>'.format(query))
        response = urllib2.urlopen(request).read()
        status = etree.XML(response).findtext('lst/int')
        return url, status
Delete documents matching `query` from Solr, return (URL, status)
recipes/Python/577909_Basic_interface_to_Apache_Solr/recipe-577909.py