Commit 4158c2e0 authored by Bas de Nooijer's avatar Bas de Nooijer

Fixed examples

parent 98cac95f
...@@ -22,7 +22,6 @@ $spellcheck->setCollateExtendedResults(true); ...@@ -22,7 +22,6 @@ $spellcheck->setCollateExtendedResults(true);
$resultset = $client->select($query); $resultset = $client->select($query);
$spellcheckResult = $resultset->getSpellcheck(); $spellcheckResult = $resultset->getSpellcheck();
echo '<h1>Correctly spelled?</h1>'; echo '<h1>Correctly spelled?</h1>';
if ($spellcheckResult->getCorrectlySpelled()) { if ($spellcheckResult->getCorrectlySpelled()) {
echo 'yes'; echo 'yes';
......
...@@ -12,7 +12,7 @@ $query = $client->createAnalysisDocument(); ...@@ -12,7 +12,7 @@ $query = $client->createAnalysisDocument();
$query->setShowMatch(true); $query->setShowMatch(true);
$query->setQuery('ipod'); $query->setQuery('ipod');
$doc = new Solarium\Document\ReadWrite( $doc = new Solarium\Query\Update\Query\Document(
array( array(
'id' => 'MA147LL', 'id' => 'MA147LL',
'name' => 'Apple 60 GB iPod with Video Playback Black', 'name' => 'Apple 60 GB iPod with Video Playback Black',
......
...@@ -10,9 +10,9 @@ htmlHeader(); ...@@ -10,9 +10,9 @@ htmlHeader();
// This makes it possible to create 'query inheritance' like in this example // This makes it possible to create 'query inheritance' like in this example
class ProductQuery extends Select{ class ProductQuery extends Select{
protected function _init() protected function init()
{ {
parent::_init(); parent::init();
// basic params // basic params
$this->setQuery('*:*'); $this->setQuery('*:*');
......
...@@ -9,7 +9,7 @@ class basicDebug extends Solarium\Core\Plugin ...@@ -9,7 +9,7 @@ class basicDebug extends Solarium\Core\Plugin
protected $start; protected $start;
protected $output = array(); protected $output = array();
public function initPlugin() public function initPlugin($client, $options)
{ {
$this->start = microtime(true); $this->start = microtime(true);
} }
...@@ -26,12 +26,12 @@ class basicDebug extends Solarium\Core\Plugin ...@@ -26,12 +26,12 @@ class basicDebug extends Solarium\Core\Plugin
echo implode('<br/>', $this->output); echo implode('<br/>', $this->output);
} }
public function preCreateRequest() public function preCreateRequest($query)
{ {
$this->timer('preCreateRequest'); $this->timer('preCreateRequest');
} }
public function postCreateRequest() public function postCreateRequest($query, $request)
{ {
$this->timer('postCreateRequest'); $this->timer('postCreateRequest');
} }
...@@ -48,37 +48,37 @@ class basicDebug extends Solarium\Core\Plugin ...@@ -48,37 +48,37 @@ class basicDebug extends Solarium\Core\Plugin
$this->output[] = 'Request URI: ' . $request->getUri(); $this->output[] = 'Request URI: ' . $request->getUri();
} }
public function postExecuteRequest() public function postExecuteRequest($request, $response)
{ {
$this->timer('postExecuteRequest'); $this->timer('postExecuteRequest');
} }
public function preCreateResult() public function preCreateResult($query, $response)
{ {
$this->timer('preCreateResult'); $this->timer('preCreateResult');
} }
public function postCreateResult() public function postCreateResult($query, $response, $result)
{ {
$this->timer('postCreateResult'); $this->timer('postCreateResult');
} }
public function preExecute() public function preExecute($query)
{ {
$this->timer('preExecute'); $this->timer('preExecute');
} }
public function postExecute() public function postExecute($query, $result)
{ {
$this->timer('postExecute'); $this->timer('postExecute');
} }
public function preCreateQuery() public function preCreateQuery($type, $options)
{ {
$this->timer('preCreateResult'); $this->timer('preCreateResult');
} }
public function postCreateQuery() public function postCreateQuery($type, $options, $query)
{ {
$this->timer('postCreateResult'); $this->timer('postCreateResult');
} }
......
<?php <?php
require('init.php'); require('init.php');
use Solarium\Client; use Solarium\Client;
use Solarium\Plugin\AbstractPlugin; use Solarium\Core\Plugin;
use Solarium\Query\Select\Query\Query as Select; use Solarium\Query\Select\Query\Query as Select;
// This is a custom query class that could have some customized logic // This is a custom query class that could have some customized logic
...@@ -11,12 +11,12 @@ class MyQuery extends Select ...@@ -11,12 +11,12 @@ class MyQuery extends Select
} }
// this very simple plugin that modifies the default querytype mapping // this very simple plugin that modifies the default querytype mapping
class queryCustomizer extends AbstractPlugin class queryCustomizer extends Plugin
{ {
protected function _initPlugin() public function initPlugin($client, $options)
{ {
$this->_client->registerQueryType( $client->registerQueryType(
Client::QUERY_SELECT, Client::QUERY_SELECT,
'MyQuery', 'MyQuery',
'Solarium\Query\Select\RequestBuilder\RequestBuilder', 'Solarium\Query\Select\RequestBuilder\RequestBuilder',
......
...@@ -10,7 +10,7 @@ htmlHeader(); ...@@ -10,7 +10,7 @@ htmlHeader();
$client = new Solarium\Client($config); $client = new Solarium\Client($config);
// set the adapter to zendhttp and get a zendhttp client instance reference // set the adapter to zendhttp and get a zendhttp client instance reference
$client->setAdapter('Solarium\Client\Adapter\ZendHttp'); $client->setAdapter('Solarium\Core\Client\Adapter\ZendHttp');
$zendHttp = $client->getAdapter()->getZendHttp(); $zendHttp = $client->getAdapter()->getZendHttp();
// you can use any of the zend_http features, like http-authentication // you can use any of the zend_http features, like http-authentication
......
...@@ -10,7 +10,7 @@ htmlHeader(); ...@@ -10,7 +10,7 @@ htmlHeader();
$client = new Solarium\Client($config); $client = new Solarium\Client($config);
// set the adapter to peclhttp // set the adapter to peclhttp
$client->setAdapter('Solarium\Client\Adapter\PeclHttp'); $client->setAdapter('Solarium\Core\Client\Adapter\PeclHttp');
// get a select query instance // get a select query instance
$query = $client->createSelect(); $query = $client->createSelect();
......
...@@ -10,7 +10,7 @@ htmlHeader(); ...@@ -10,7 +10,7 @@ htmlHeader();
$client = new Solarium\Client($config); $client = new Solarium\Client($config);
// set the adapter to curl // set the adapter to curl
$client->setAdapter('Solarium\Client\Adapter\Curl'); $client->setAdapter('Solarium\Core\Client\Adapter\Curl');
// get a select query instance // get a select query instance
$query = $client->createSelect(); $query = $client->createSelect();
......
...@@ -2,8 +2,9 @@ ...@@ -2,8 +2,9 @@
require('init.php'); require('init.php');
// this very simple plugin is used to show some events // this very simple plugin is used to show some events
class simpleDebug extends \Solarium\Plugin\AbstractPlugin class simpleDebug extends Solarium\Core\Plugin
{ {
protected $_output = array(); protected $_output = array();
public function display() public function display()
......
...@@ -83,7 +83,7 @@ class ParallelExecution extends Plugin ...@@ -83,7 +83,7 @@ class ParallelExecution extends Plugin
*/ */
protected function initPluginType() protected function initPluginType()
{ {
$this->client->setAdapter('Solarium\Client\Adapter\Curl'); $this->client->setAdapter('Solarium\Core\Client\Adapter\Curl');
} }
/** /**
......
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