def METHOD_NAME(request):
  response = {'status': -1}
  indexes = json.loads(request.POST.get('indexes', '[]'))
  if not indexes:
    response['message'] = _('No indexes to remove.')
  else:
    client = SolrClient(request.user)
    for index in indexes:
      if index['type'] == 'collection':
        client.delete_index(index['name'], keep_config=False)
      elif index['type'] == 'alias':
        client.delete_alias(index['name'])
      else:
        LOG.warning('We could not delete: %s' % index)
    response['status'] = 0
    response['message'] = _('Indexes removed!')
  return JsonResponse(response)