SolrClient::deleteByQuery
Deletes all documents matching the given query
&reftitle.description;
public SolrUpdateResponseSolrClient::deleteByQuery
stringquery
Deletes all documents matching the given query.
&reftitle.parameters;
query
The query
&reftitle.returnvalues;
Returns a SolrUpdateResponse on success and throws an exception on failure.
&reftitle.errors;
Throws SolrClientException if the client had failed, or there was a connection issue.
Throws SolrServerException if the Solr Server had failed to process the request.
&reftitle.examples;
SolrQuery::deleteByQuery example
SOLR_SERVER_HOSTNAME,
'login' => SOLR_SERVER_USERNAME,
'password' => SOLR_SERVER_PASSWORD,
'port' => SOLR_SERVER_PORT,
);
$client = new SolrClient($options);
//This will erase the entire index
$client->deleteByQuery("*:*");
$client->commit();
?>
]]>
&reftitle.seealso;
SolrClient::deleteById
SolrClient::deleteByIds
SolrClient::deleteByQueries