You are here

public function DrupalApacheSolrService::deleteByMultipleIds in Apache Solr Search 8

Same name and namespace in other branches
  1. 6.3 Drupal_Apache_Solr_Service.php \DrupalApacheSolrService::deleteByMultipleIds()
  2. 7 Drupal_Apache_Solr_Service.php \DrupalApacheSolrService::deleteByMultipleIds()

Create and post a delete document based on multiple document IDs.

Parameters

array $ids Expected to be utf-8 encoded strings:

float $timeout Maximum expected duration of the delete operation on the server (otherwise, will throw a communication exception):

Return value

response object

Throws

Exception If an error occurs during the service call

Overrides DrupalApacheSolrServiceInterface::deleteByMultipleIds

1 call to DrupalApacheSolrService::deleteByMultipleIds()
DrupalApacheSolrService::deleteById in ./Drupal_Apache_Solr_Service.php
Create a delete document based on document ID

File

./Drupal_Apache_Solr_Service.php, line 772

Class

DrupalApacheSolrService
Starting point for the Solr API. Represents a Solr server resource and has methods for pinging, adding, deleting, committing, optimizing and searching.

Code

public function deleteByMultipleIds($ids, $timeout = 3600) {
  $rawPost = '<delete>';
  foreach ($ids as $id) {
    $rawPost .= '<id>' . htmlspecialchars($id, ENT_NOQUOTES, 'UTF-8') . '</id>';
  }
  $rawPost .= '</delete>';
  return $this
    ->update($rawPost, $timeout);
}