本文整理汇总了PHP中Solarium_Client::createUpdate方法的典型用法代码示例。如果您正苦于以下问题:PHP Solarium_Client::createUpdate方法的具体用法?PHP Solarium_Client::createUpdate怎么用?PHP Solarium_Client::createUpdate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Solarium_Client
的用法示例。
在下文中一共展示了Solarium_Client::createUpdate方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: deleteBundlesIndexes
/**
* Delete all bundles from index
*/
public function deleteBundlesIndexes(Bundle $bundle = null)
{
$delete = $this->solarium->createUpdate();
$delete->addDeleteQuery(null !== $bundle ? $bundle->getFullName() : '*:*');
$delete->addCommit();
$this->solarium->update($delete);
}
示例2: testPostCreateRequestUnalteredPostRequest
public function testPostCreateRequestUnalteredPostRequest()
{
$query = $this->_client->createUpdate();
$query->addDeleteById(1);
$requestOutput = $this->_client->createRequest($query);
$requestInput = clone $requestOutput;
$this->_plugin->postCreateRequest($query, $requestOutput);
$this->assertEquals($requestInput, $requestOutput);
}
示例3: delete
/** Delete record by ID
*
* @param $id
*/
public function delete($id)
{
$solr = new Solarium_Client(array('adapteroptions' => array('host' => '127.0.0.1', 'port' => 8983, 'path' => '/solr/', 'core' => 'beowulf')));
$update = $solr->createUpdate();
$update->addDeleteById('findIdentifier-' . $id);
$update->addCommit();
$result = $solr->update($update);
}
示例4:
<?php
require 'init.php';
htmlHeader();
// create a client instance
$client = new Solarium_Client($config);
// get an update query instance
$update = $client->createUpdate();
// add the delete query and a commit command to the update query
$update->addDeleteQuery('name:testdoc*');
$update->addCommit();
// 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();