code: public function deleteByQuery($query)
      {
          $endpoints = $this->endpointResolver->getEndpoints();
  
          foreach ($endpoints as $endpointName) {
              $this->client->request(
                  'POST',
                  $this->endpointRegistry->getEndpoint($endpointName),
                  '/update?wt=json',
                  new Message(
                      array(
                          'Content-Type' => 'text/xml',
                      ),
                      "<delete><query>{$query}</query></delete>"
                  )
              );
          }
      }
docs: Deletes documents by the given $query.
  
  @param string $query