Commit a09c06c9 authored by Bas de Nooijer's avatar Bas de Nooijer

- added two examples

parent 83e775e9
<?php
require('init.php');
htmlHeader();
// create a client instance
$client = new Solarium_Client($config);
// get an update query instance
$update = $client->createUpdate();
// optimize the index
$update->addOptimize(true, false, 5);
// this executes the query and returns the result
$result = $client->update($update);
echo '<b>Update query executed<b><br/>';
echo 'Query status: ' . $result->getStatus(). '<br/>';
echo 'Query time: ' . $result->getQueryTime();
htmlFooter();
\ No newline at end of file
<?php
require('init.php');
htmlHeader();
// create a client instance
$client = new Solarium_Client($config);
// get an update query instance
$update = $client->createUpdate();
// rollback any uncommitted changes on the Solr server
$update->addRollback();
// this executes the query and returns the result
$result = $client->update($update);
echo '<b>Update query executed<b><br/>';
echo 'Query status: ' . $result->getStatus(). '<br/>';
echo 'Query time: ' . $result->getQueryTime();
htmlFooter();
\ No newline at end of file
......@@ -53,6 +53,8 @@
<li><a href="3.1-add-docs.php">3.1 Add docs</a></li>
<li><a href="3.2-delete-by-query.php">3.2 Delete by query</a></li>
<li><a href="3.3-delete-by-id.php">3.3 Delete by ID</a></li>
<li><a href="3.4-optimize.php">3.4 Optimize index</a></li>
<li><a href="3.5-rollback.php">3.5 Rollback</a></li>
</ul>
<li>4. Usage modes</li>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment