def _resetIndex(self, baseURL):
"""Reset the Solr index."""
url = urljoin(baseURL, '/solr/update?wt=json')
headers = {'User-Agent': 'FluidDB test suite',
'Content-Type': 'text/xml'}
body = '<delete><query>*:*</query></delete>'
response, content = Http().request(url, 'POST', body, headers)
if response.status != 200:
raise RuntimeError(
"Couldn't clear Solr index! Got HTTP %s return code and "
'content: %s', (response.status, content))
url = urljoin(baseURL, '/solr/update?wt=json')
headers = {'User-Agent': 'FluidDB test suite',
'Content-Type': 'text/xml'}
body = '<commit></commit>'
response, content = Http().request(url, 'POST', body, headers)
if response.status != 200:
raise RuntimeError(
"Couldn't commit Solr index! Got HTTP %s return code and "
'content: %s', (response.status, content))
评论列表
文章目录