Commit 2ab3d9f1 authored by Bas de Nooijer's avatar Bas de Nooijer

Refactored sharding into a select query component

Improved testcoverage for spellcheck
parent ab585d41
...@@ -63,13 +63,6 @@ class Solarium_Client_RequestBuilder_Select extends Solarium_Client_RequestBuild ...@@ -63,13 +63,6 @@ class Solarium_Client_RequestBuilder_Select extends Solarium_Client_RequestBuild
$request->addParam('fl', implode(',', $query->getFields())); $request->addParam('fl', implode(',', $query->getFields()));
$request->addParam('wt', 'json'); $request->addParam('wt', 'json');
// add shard fields to request
$shards = array_values($query->getShards());
if (count($shards)) {
$request->addParam('shards', implode(',', $shards));
}
$request->addParam('shards.qt', $query->getShardRequestHandler());
// add sort fields to request // add sort fields to request
$sort = array(); $sort = array();
foreach ($query->getSorts() AS $field => $order) { foreach ($query->getSorts() AS $field => $order) {
......
<?php
/**
* Copyright 2011 Bas de Nooijer. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this listof conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are
* those of the authors and should not be interpreted as representing official
* policies, either expressed or implied, of the copyright holder.
*
* @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
* @license http://github.com/basdenooijer/solarium/raw/master/COPYING
* @link http://www.solarium-project.org/
*
* @package Solarium
* @subpackage Client
*/
/**
* Add select component distributedsearch to the request
*
* @package Solarium
* @subpackage Client
*/
class Solarium_Client_RequestBuilder_Select_Component_DistributedSearch
{
/**
* Add request settings for DistributedSearch
*
* @param Solarium_Query_Select_Component_DistributedSearch $component
* @param Solarium_Client_Request $request
* @return Solarium_Client_Request
*/
public function build($component, $request)
{
// add shard fields to request
$shards = array_values($component->getShards());
if (count($shards)) {
$request->addParam('shards', implode(',', $shards));
}
$request->addParam('shards.qt', $component->getShardRequestHandler());
return $request;
}
}
\ No newline at end of file
...@@ -89,6 +89,11 @@ class Solarium_Query_Select extends Solarium_Query ...@@ -89,6 +89,11 @@ class Solarium_Query_Select extends Solarium_Query
*/ */
const COMPONENT_GROUPING = 'grouping'; const COMPONENT_GROUPING = 'grouping';
/**
* Query component distributed search
*/
const COMPONENT_DISTRIBUTEDSEARCH = 'distributedsearch';
/** /**
* Get type for this query * Get type for this query
* *
...@@ -101,7 +106,7 @@ class Solarium_Query_Select extends Solarium_Query ...@@ -101,7 +106,7 @@ class Solarium_Query_Select extends Solarium_Query
/** /**
* Default options * Default options
* *
* @var array * @var array
*/ */
protected $_options = array( protected $_options = array(
...@@ -116,7 +121,7 @@ class Solarium_Query_Select extends Solarium_Query ...@@ -116,7 +121,7 @@ class Solarium_Query_Select extends Solarium_Query
/** /**
* Default select query component types * Default select query component types
* *
* @var array * @var array
*/ */
protected $_componentTypes = array( protected $_componentTypes = array(
...@@ -150,6 +155,11 @@ class Solarium_Query_Select extends Solarium_Query ...@@ -150,6 +155,11 @@ class Solarium_Query_Select extends Solarium_Query
'requestbuilder' => 'Solarium_Client_RequestBuilder_Select_Component_Spellcheck', 'requestbuilder' => 'Solarium_Client_RequestBuilder_Select_Component_Spellcheck',
'responseparser' => 'Solarium_Client_ResponseParser_Select_Component_Spellcheck', 'responseparser' => 'Solarium_Client_ResponseParser_Select_Component_Spellcheck',
), ),
self::COMPONENT_DISTRIBUTEDSEARCH => array(
'component' => 'Solarium_Query_Select_Component_DistributedSearch',
'requestbuilder' => 'Solarium_Client_RequestBuilder_Select_Component_DistributedSearch',
'responseparser' => null,
),
); );
/** /**
...@@ -166,13 +176,6 @@ class Solarium_Query_Select extends Solarium_Query ...@@ -166,13 +176,6 @@ class Solarium_Query_Select extends Solarium_Query
*/ */
protected $_sorts = array(); protected $_sorts = array();
/**
* Request to be distributed across all shards in the list
*
* @var array
*/
protected $_shards = array();
/** /**
* Filterqueries * Filterqueries
* *
...@@ -192,7 +195,7 @@ class Solarium_Query_Select extends Solarium_Query ...@@ -192,7 +195,7 @@ class Solarium_Query_Select extends Solarium_Query
* *
* Several options need some extra checks or setup work, for these options * Several options need some extra checks or setup work, for these options
* the setters are called. * the setters are called.
* *
* @return void * @return void
*/ */
protected function _init() protected function _init()
...@@ -217,9 +220,6 @@ class Solarium_Query_Select extends Solarium_Query ...@@ -217,9 +220,6 @@ class Solarium_Query_Select extends Solarium_Query
case 'start': case 'start':
$this->setStart((int)$value); $this->setStart((int)$value);
break; break;
case 'shards':
$this->setShards($value);
break;
case 'component': case 'component':
$this->_createComponents($value); $this->_createComponents($value);
break; break;
...@@ -315,7 +315,7 @@ class Solarium_Query_Select extends Solarium_Query ...@@ -315,7 +315,7 @@ class Solarium_Query_Select extends Solarium_Query
* Get the current documentclass option * Get the current documentclass option
* *
* The value is a classname, not an instance * The value is a classname, not an instance
* *
* @return string * @return string
*/ */
public function getDocumentClass() public function getDocumentClass()
...@@ -513,132 +513,6 @@ class Solarium_Query_Select extends Solarium_Query ...@@ -513,132 +513,6 @@ class Solarium_Query_Select extends Solarium_Query
return $this; return $this;
} }
/**
* Add a shard
*
* @param string $key unique string
* @param string $shard The syntax is host:port/base_url
* @return Solarium_Query_Select Provides fluent interface
* @link http://wiki.apache.org/solr/DistributedSearch
*/
public function addShard($key, $shard)
{
$this->_shards[$key] = $shard;
return $this;
}
/**
* Add multiple shards
*
* Example usage:
* <code>
* $client = new Solarium_Client;
* $query = $client->createSelect();
* $query->addShards(array(
* 'core0' => 'localhost:8983/solr/core0',
* 'core1' => 'localhost:8983/solr/core1'
* ));
* $result = $client->select($query);
* </code>
* @param array $shards
* @return Solarium_Query_Select Provides fluent interface
*/
public function addShards(array $shards)
{
foreach ($shards as $key => $shard) {
$this->addShard($key, $shard);
}
return $this;
}
/**
* Remove a shard
*
* @param string $key
* @return Solarium_Query_Select Provides fluent interface
*/
public function removeShard($key)
{
if (isset($this->_shards[$key])) {
unset($this->_shards[$key]);
}
return $this;
}
/**
* Remove all shards
*
* @return Solarium_Query_Select Provides fluent interface
*/
public function clearShards()
{
$this->_shards = array();
return $this;
}
/**
* Set multiple shards
*
* This overwrites any existing shards
*
* Example usage:
* <code>
* $client = new Solarium_Client;
* $query = $client->createSelect();
* $query->setShards(array(
* 'core0' => 'localhost:8983/solr/core0',
* 'core1' => 'localhost:8983/solr/core1'
* ));
* $result = $client->select($query);
* </code>
*
* @param array $shards Associative array of shards
* @return Solarium_Query_Select Provides fluent interface
*/
public function setShards(array $shards)
{
$this->clearShards();
$this->addShards($shards);
return $this;
}
/**
* Get a list of the shards
*
* @return array
*/
public function getShards()
{
return $this->_shards;
}
/**
* A sharded request will go to the standard request handler
* (not necessarily the original); this can be overridden via shards.qt
*
* @param string
* @return Solarium_Query_Select Provides fluent interface
*/
public function setShardRequestHandler($handler)
{
$this->_setOption('shardhandler', $handler);
return $this;
}
/**
* Get a shard request handler (shards.qt)
*
* @param string
* @return Solarium_Query_Select Provides fluent interface
*/
public function getShardRequestHandler()
{
return $this->getOption('shardhandler');
}
/** /**
* Create a filterquery instance * Create a filterquery instance
* *
...@@ -682,7 +556,7 @@ class Solarium_Query_Select extends Solarium_Query ...@@ -682,7 +556,7 @@ class Solarium_Query_Select extends Solarium_Query
if (is_array($filterQuery)) { if (is_array($filterQuery)) {
$filterQuery = new Solarium_Query_Select_FilterQuery($filterQuery); $filterQuery = new Solarium_Query_Select_FilterQuery($filterQuery);
} }
$key = $filterQuery->getKey(); $key = $filterQuery->getKey();
if (0 === strlen($key)) { if (0 === strlen($key)) {
...@@ -826,7 +700,7 @@ class Solarium_Query_Select extends Solarium_Query ...@@ -826,7 +700,7 @@ class Solarium_Query_Select extends Solarium_Query
/** /**
* Get all registered components * Get all registered components
* *
* @return array * @return array
*/ */
public function getComponents() public function getComponents()
...@@ -855,7 +729,7 @@ class Solarium_Query_Select extends Solarium_Query ...@@ -855,7 +729,7 @@ class Solarium_Query_Select extends Solarium_Query
if (!isset($this->_componentTypes[$key])) { if (!isset($this->_componentTypes[$key])) {
throw new Solarium_Exception('Cannot autoload unknown component: ' . $key); throw new Solarium_Exception('Cannot autoload unknown component: ' . $key);
} }
$className = $this->_componentTypes[$key]['component']; $className = $this->_componentTypes[$key]['component'];
$component = new $className($config); $component = new $className($config);
$this->setComponent($key, $component); $this->setComponent($key, $component);
...@@ -992,4 +866,16 @@ class Solarium_Query_Select extends Solarium_Query ...@@ -992,4 +866,16 @@ class Solarium_Query_Select extends Solarium_Query
return $this->getComponent(Solarium_Query_Select::COMPONENT_SPELLCHECK, true); return $this->getComponent(Solarium_Query_Select::COMPONENT_SPELLCHECK, true);
} }
/*
* Get a DistributedSearch component instance
*
* This is a convenience method that maps presets to getComponent
*
* @return Solarium_Query_Select_Component_DistributedSearch
*/
public function getDistributedSearch()
{
return $this->getComponent(Solarium_Query_Select::COMPONENT_DISTRIBUTEDSEARCH, true);
}
} }
<?php
/**
* Copyright 2011 Bas de Nooijer. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this listof conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are
* those of the authors and should not be interpreted as representing official
* policies, either expressed or implied, of the copyright holder.
*
* @copyright Copyright 2011 Bas de Nooijer <solarium@raspberry.nl>
* @license http://github.com/basdenooijer/solarium/raw/master/COPYING
* @link http://www.solarium-project.org/
*
* @package Solarium
* @subpackage Query
*/
/**
* Distributed Search (sharding) component
*
* @link http://wiki.apache.org/solr/DistributedSearch
*
* @package Solarium
* @subpackage Query
*/
class Solarium_Query_Select_Component_DistributedSearch extends Solarium_Query_Select_Component
{
/**
* Component type
*
* @var string
*/
protected $_type = Solarium_Query_Select::COMPONENT_DISTRIBUTEDSEARCH;
/**
* Request to be distributed across all shards in the list
*
* @var array
*/
protected $_shards = array();
/**
* Initialize options
*
* Several options need some extra checks or setup work, for these options
* the setters are called.
*
* @return void
*/
protected function _init()
{
foreach ($this->_options AS $name => $value) {
switch ($name) {
case 'shards':
$this->setShards($value);
break;
}
}
}
/**
* Add a shard
*
* @param string $key unique string
* @param string $shard The syntax is host:port/base_url
* @return Solarium_Query_Select Provides fluent interface
* @link http://wiki.apache.org/solr/DistributedSearch
*/
public function addShard($key, $shard)
{
$this->_shards[$key] = $shard;
return $this;
}
/**
* Add multiple shards
*
* Example usage:
* <code>
* $client = new Solarium_Client;
* $query = $client->createSelect();
* $distributedSearch = $query->getDistributedSearch();
* $distributedSearch->addShards(array(
* 'core0' => 'localhost:8983/solr/core0',
* 'core1' => 'localhost:8983/solr/core1'
* ));
* $result = $client->select($query);
* </code>
* @param array $shards
* @return Solarium_Query_Select Provides fluent interface
*/
public function addShards(array $shards)
{
foreach ($shards as $key => $shard) {
$this->addShard($key, $shard);
}
return $this;
}
/**
* Remove a shard
*
* @param string $key
* @return Solarium_Query_Select Provides fluent interface
*/
public function removeShard($key)
{
if (isset($this->_shards[$key])) {
unset($this->_shards[$key]);
}
return $this;
}
/**
* Remove all shards
*
* @return Solarium_Query_Select Provides fluent interface
*/
public function clearShards()
{
$this->_shards = array();
return $this;
}
/**
* Set multiple shards
*
* This overwrites any existing shards
*
* Example usage:
* <code>
* $client = new Solarium_Client;
* $query = $client->createSelect();
* $distributedSearch = $query->getDistributedSearch();
* $distributedSearch->setShards(array(
* 'core0' => 'localhost:8983/solr/core0',
* 'core1' => 'localhost:8983/solr/core1'
* ));
* $result = $client->select($query);
* </code>
*
* @param array $shards Associative array of shards
* @return Solarium_Query_Select Provides fluent interface
*/
public function setShards(array $shards)
{
$this->clearShards();
$this->addShards($shards);
return $this;
}
/**
* Get a list of the shards
*
* @return array
*/
public function getShards()
{
return $this->_shards;
}
/**
* A sharded request will go to the standard request handler
* (not necessarily the original); this can be overridden via shards.qt
*
* @param string
* @return Solarium_Query_Select Provides fluent interface
*/
public function setShardRequestHandler($handler)
{
$this->_setOption('shardhandler', $handler);
return $this;
}
/**
* Get a shard request handler (shards.qt)
*
* @param string
* @return Solarium_Query_Select Provides fluent interface
*/
public function getShardRequestHandler()
{
return $this->getOption('shardhandler');
}
}
\ No newline at end of file
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
* Spellcheck component * Spellcheck component
* *
* @link http://wiki.apache.org/solr/SpellCheckComponent * @link http://wiki.apache.org/solr/SpellCheckComponent
* *
* @package Solarium * @package Solarium
* @subpackage Query * @subpackage Query
*/ */
...@@ -48,7 +48,7 @@ class Solarium_Query_Select_Component_Spellcheck extends Solarium_Query_Select_C ...@@ -48,7 +48,7 @@ class Solarium_Query_Select_Component_Spellcheck extends Solarium_Query_Select_C
{ {
/** /**
* Component type * Component type
* *
* @var string * @var string
*/ */
protected $_type = Solarium_Query_Select::COMPONENT_SPELLCHECK; protected $_type = Solarium_Query_Select::COMPONENT_SPELLCHECK;
...@@ -81,7 +81,7 @@ class Solarium_Query_Select_Component_Spellcheck extends Solarium_Query_Select_C ...@@ -81,7 +81,7 @@ class Solarium_Query_Select_Component_Spellcheck extends Solarium_Query_Select_C
* *
* Build the spellcheck? * Build the spellcheck?
* *
* @param string $build * @param boolean $build
* @return Solarium_Query_Select_Component_Spellcheck Provides fluent interface * @return Solarium_Query_Select_Component_Spellcheck Provides fluent interface
*/ */
public function setBuild($build) public function setBuild($build)
...@@ -92,7 +92,7 @@ class Solarium_Query_Select_Component_Spellcheck extends Solarium_Query_Select_C ...@@ -92,7 +92,7 @@ class Solarium_Query_Select_Component_Spellcheck extends Solarium_Query_Select_C
/** /**
* Get build option * Get build option
* *
* @return string|null * @return boolean|null
*/ */
public function getBuild() public function getBuild()
{ {
...@@ -104,7 +104,7 @@ class Solarium_Query_Select_Component_Spellcheck extends Solarium_Query_Select_C ...@@ -104,7 +104,7 @@ class Solarium_Query_Select_Component_Spellcheck extends Solarium_Query_Select_C
* *
* Reload the dictionary? * Reload the dictionary?
* *
* @param string $reload * @param boolean $reload
* @return Solarium_Query_Select_Component_Spellcheck Provides fluent interface * @return Solarium_Query_Select_Component_Spellcheck Provides fluent interface
*/ */
public function setReload($reload) public function setReload($reload)
...@@ -115,7 +115,7 @@ class Solarium_Query_Select_Component_Spellcheck extends Solarium_Query_Select_C ...@@ -115,7 +115,7 @@ class Solarium_Query_Select_Component_Spellcheck extends Solarium_Query_Select_C
/** /**
* Get fragsize option * Get fragsize option
* *
* @return string|null * @return boolean|null
*/ */
public function getReload() public function getReload()
{ {
...@@ -149,7 +149,7 @@ class Solarium_Query_Select_Component_Spellcheck extends Solarium_Query_Select_C ...@@ -149,7 +149,7 @@ class Solarium_Query_Select_Component_Spellcheck extends Solarium_Query_Select_C
* Set count option * Set count option
* *
* The maximum number of suggestions to return * The maximum number of suggestions to return
* *
* @param int $count * @param int $count
* @return Solarium_Query_Select_Component_Spellcheck Provides fluent interface * @return Solarium_Query_Select_Component_Spellcheck Provides fluent interface
*/ */
...@@ -173,7 +173,7 @@ class Solarium_Query_Select_Component_Spellcheck extends Solarium_Query_Select_C ...@@ -173,7 +173,7 @@ class Solarium_Query_Select_Component_Spellcheck extends Solarium_Query_Select_C
* *
* Only return suggestions that result in more hits for the query than the existing query * Only return suggestions that result in more hits for the query than the existing query
* *
* @param string $onlyMorePopular * @param boolean $onlyMorePopular
* @return Solarium_Query_Select_Component_Spellcheck Provides fluent interface * @return Solarium_Query_Select_Component_Spellcheck Provides fluent interface
*/ */
public function setOnlyMorePopular($onlyMorePopular) public function setOnlyMorePopular($onlyMorePopular)
...@@ -184,7 +184,7 @@ class Solarium_Query_Select_Component_Spellcheck extends Solarium_Query_Select_C ...@@ -184,7 +184,7 @@ class Solarium_Query_Select_Component_Spellcheck extends Solarium_Query_Select_C
/** /**
* Get onlyMorePopular option * Get onlyMorePopular option
* *
* @return string|null * @return boolean|null
*/ */
public function getOnlyMorePopular() public function getOnlyMorePopular()
{ {
...@@ -194,7 +194,7 @@ class Solarium_Query_Select_Component_Spellcheck extends Solarium_Query_Select_C ...@@ -194,7 +194,7 @@ class Solarium_Query_Select_Component_Spellcheck extends Solarium_Query_Select_C
/** /**
* Set extendedResults option * Set extendedResults option
* *
* @param string $extendedResults * @param boolean $extendedResults
* @return Solarium_Query_Select_Component_Spellcheck Provides fluent interface * @return Solarium_Query_Select_Component_Spellcheck Provides fluent interface
*/ */
public function setExtendedResults($extendedResults) public function setExtendedResults($extendedResults)
...@@ -205,7 +205,7 @@ class Solarium_Query_Select_Component_Spellcheck extends Solarium_Query_Select_C ...@@ -205,7 +205,7 @@ class Solarium_Query_Select_Component_Spellcheck extends Solarium_Query_Select_C
/** /**
* Get extendedResults option * Get extendedResults option
* *
* @return string|null * @return boolean|null
*/ */
public function getExtendedResults() public function getExtendedResults()
{ {
...@@ -215,7 +215,7 @@ class Solarium_Query_Select_Component_Spellcheck extends Solarium_Query_Select_C ...@@ -215,7 +215,7 @@ class Solarium_Query_Select_Component_Spellcheck extends Solarium_Query_Select_C
/** /**
* Set collate option * Set collate option
* *
* @param string $collate * @param boolean $collate
* @return Solarium_Query_Select_Component_Spellcheck Provides fluent interface * @return Solarium_Query_Select_Component_Spellcheck Provides fluent interface
*/ */
public function setCollate($collate) public function setCollate($collate)
...@@ -226,7 +226,7 @@ class Solarium_Query_Select_Component_Spellcheck extends Solarium_Query_Select_C ...@@ -226,7 +226,7 @@ class Solarium_Query_Select_Component_Spellcheck extends Solarium_Query_Select_C
/** /**
* Get collate option * Get collate option
* *
* @return string|null * @return boolean|null
*/ */
public function getCollate() public function getCollate()
{ {
...@@ -337,5 +337,5 @@ class Solarium_Query_Select_Component_Spellcheck extends Solarium_Query_Select_C ...@@ -337,5 +337,5 @@ class Solarium_Query_Select_Component_Spellcheck extends Solarium_Query_Select_C
{ {
return $this->getOption('accuracy'); return $this->getOption('accuracy');
} }
} }
\ No newline at end of file
<?php
/**
* Copyright 2011 Bas de Nooijer. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this listof conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are
* those of the authors and should not be interpreted as representing official
* policies, either expressed or implied, of the copyright holder.
*/
class Solarium_Client_RequestBuilder_Select_Component_DistributedSearchTest extends PHPUnit_Framework_TestCase
{
public function testBuild()
{
$builder = new Solarium_Client_RequestBuilder_Select_Component_DistributedSearch;
$request = new Solarium_Client_Request();
$component = new Solarium_Query_Select_Component_DistributedSearch();
$component->addShard('shard1', 'localhost:8983/solr/shard1');
$component->addShards(array(
'shard2' => 'localhost:8983/solr/shard2',
'shard3' => 'localhost:8983/solr/shard3'
));
$component->setShardRequestHandler('dummy');
$request = $builder->build($component, $request);
$this->assertEquals(
array(
'shards.qt' => 'dummy',
'shards' => 'localhost:8983/solr/shard1,localhost:8983/solr/shard2,localhost:8983/solr/shard3',
),
$request->getParams()
);
}
}
\ No newline at end of file
<?php
/**
* Copyright 2011 Bas de Nooijer. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this listof conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are
* those of the authors and should not be interpreted as representing official
* policies, either expressed or implied, of the copyright holder.
*/
class Solarium_Client_RequestBuilder_Select_Component_SpellcheckTest extends PHPUnit_Framework_TestCase
{
public function testBuild()
{
$builder = new Solarium_Client_RequestBuilder_Select_Component_Spellcheck();
$request = new Solarium_Client_Request();
$component = new Solarium_Query_Select_Component_Spellcheck();
$component->setQuery('testquery');
$component->setBuild(false);
$component->setReload(true);
$component->setDictionary('testdict');
$component->setCount(3);
$component->setOnlyMorePopular(false);
$component->setExtendedResults(true);
$component->setCollate(true);
$component->setMaxCollations(2);
$component->setMaxCollationTries(4);
$component->setMaxCollationEvaluations(4);
$component->setCollateExtendedResults(true);
$component->setAccuracy(.2);
$request = $builder->build($component, $request);
$this->assertEquals(
array(
'spellcheck' => 'true',
'spellcheck.q' => 'testquery',
'spellcheck.build' => 'false',
'spellcheck.reload' => 'true',
'spellcheck.dictionary' => 'testdict',
'spellcheck.count' => 3,
'spellcheck.onlyMorePopular' => 'false',
'spellcheck.extendedResults' => 'true',
'spellcheck.collate' => 'true',
'spellcheck.maxCollations' => 2,
'spellcheck.maxCollationTries' => 4,
'spellcheck.maxCollationEvaluations' => 4,
'spellcheck.collateExtendedResults' => 'true',
'spellcheck.accuracy' => .2,
),
$request->getParams()
);
}
}
\ No newline at end of file
...@@ -89,29 +89,6 @@ class Solarium_Client_RequestBuilder_SelectTest extends PHPUnit_Framework_TestCa ...@@ -89,29 +89,6 @@ class Solarium_Client_RequestBuilder_SelectTest extends PHPUnit_Framework_TestCa
); );
} }
public function testSelectUrlWithShard()
{
$this->_query->addShard('shard1', 'localhost:8983/solr/shard1');
$this->_query->addShards(array(
'shard2' => 'localhost:8983/solr/shard2',
'shard3' => 'localhost:8983/solr/shard3'
));
$this->_query->setShardRequestHandler('dummy');
$request = $this->_builder->build($this->_query);
$this->assertEquals(
null,
$request->getRawData()
);
$this->assertEquals(
'select?q=*:*&start=0&rows=10&fl=*,score&wt=json' .
'&shards=localhost:8983/solr/shard1,localhost:8983/solr/shard2,localhost:8983/solr/shard3' .
'&shards.qt=dummy',
urldecode($request->getUri())
);
}
public function testSelectUrlWithSortAndFilters() public function testSelectUrlWithSortAndFilters()
{ {
$this->_query->addSort('id', Solarium_Query_Select::SORT_ASC); $this->_query->addSort('id', Solarium_Query_Select::SORT_ASC);
...@@ -156,7 +133,7 @@ class Solarium_Client_RequestBuilder_SelectTest extends PHPUnit_Framework_TestCa ...@@ -156,7 +133,7 @@ class Solarium_Client_RequestBuilder_SelectTest extends PHPUnit_Framework_TestCa
$request->getParam('defType') $request->getParam('defType')
); );
} }
} }
class TestDummyComponent extends Solarium_Query_Select_Component{ class TestDummyComponent extends Solarium_Query_Select_Component{
......
<?php
/**
* Copyright 2011 Bas de Nooijer. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this listof conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are
* those of the authors and should not be interpreted as representing official
* policies, either expressed or implied, of the copyright holder.
*/
class Solarium_Query_Select_Component_DistributedSearchTest extends PHPUnit_Framework_TestCase
{
/**
* @var Solarium_Query_Select_Component_DistributedSearch
*/
protected $_distributedSearch;
public function setUp()
{
$this->_distributedSearch = new Solarium_Query_Select_Component_DistributedSearch;
}
public function testConfigMode()
{
$options = array(
'shardhandler' => 'dummyhandler',
'shards' => array(
'shard1' => 'localhost:8983/solr/shard1',
'shard2' => 'localhost:8983/solr/shard2',
)
);
$this->_distributedSearch->setOptions($options);
$this->assertEquals($options['shardhandler'], $this->_distributedSearch->getShardRequestHandler());
$this->assertEquals($options['shards'], $this->_distributedSearch->getShards());
}
public function testGetType()
{
$this->assertEquals(
Solarium_Query_Select::COMPONENT_DISTRIBUTEDSEARCH,
$this->_distributedSearch->getType()
);
}
public function testAddShard()
{
$this->_distributedSearch->addShard('shard1', 'localhost:8983/solr/shard1');
$shards = $this->_distributedSearch->getShards();
$this->assertEquals(
'localhost:8983/solr/shard1',
$shards['shard1']
);
}
public function testRemoveShard()
{
$this->_distributedSearch->addShard('shard1', 'localhost:8983/solr/shard1');
$this->_distributedSearch->removeShard('shard1');
$shards = $this->_distributedSearch->getShards();
$this->assertFalse(isset($shards['shard1']));
}
public function testClearShards()
{
$this->_distributedSearch->addShards(array(
'shard1' => 'localhost:8983/solr/shard1',
'shard2' => 'localhost:8983/solr/shard2',
));
$this->_distributedSearch->clearShards();
$shards = $this->_distributedSearch->getShards();
$this->assertTrue(is_array($shards));
$this->assertEquals(0, count($shards));
}
public function testAddShards()
{
$shards = array(
'shard1' => 'localhost:8983/solr/shard1',
'shard2' => 'localhost:8983/solr/shard2',
);
$this->_distributedSearch->addShards($shards);
$this->assertEquals($shards, $this->_distributedSearch->getShards());
}
public function testSetShards()
{
$this->_distributedSearch->addShards(array(
'shard1' => 'localhost:8983/solr/shard1',
'shard2' => 'localhost:8983/solr/shard2',
));
$this->_distributedSearch->setShards(array(
'shard3' => 'localhost:8983/solr/shard3',
'shard4' => 'localhost:8983/solr/shard4',
'shard5' => 'localhost:8983/solr/shard5',
));
$shards = $this->_distributedSearch->getShards();
$this->assertEquals(3, count($shards));
$this->assertEquals(array(
'shard3' => 'localhost:8983/solr/shard3',
'shard4' => 'localhost:8983/solr/shard4',
'shard5' => 'localhost:8983/solr/shard5',
), $shards);
}
public function testSetShardRequestHandler()
{
$this->_distributedSearch->setShardRequestHandler('dummy');
$this->assertEquals(
'dummy',
$this->_distributedSearch->getShardRequestHandler()
);
}
}
<?php
/**
* Copyright 2011 Bas de Nooijer. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this listof conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are
* those of the authors and should not be interpreted as representing official
* policies, either expressed or implied, of the copyright holder.
*/
class Solarium_Query_Select_Component_SpellcheckTest extends PHPUnit_Framework_TestCase
{
/**
* @var Solarium_Query_Select_Component_Spellcheck
*/
protected $_spellCheck;
public function setUp()
{
$this->_spellCheck = new Solarium_Query_Select_Component_Spellcheck;
}
public function testGetType()
{
$this->assertEquals(Solarium_Query_Select::COMPONENT_SPELLCHECK, $this->_spellCheck->getType());
}
public function testSetAndGetQuery()
{
$value = 'testquery';
$this->_spellCheck->setQuery($value);
$this->assertEquals(
$value,
$this->_spellCheck->getQuery()
);
}
public function testSetAndGetBuild()
{
$value = true;
$this->_spellCheck->setBuild($value);
$this->assertEquals(
$value,
$this->_spellCheck->getBuild()
);
}
public function testSetAndGetReload()
{
$value = false;
$this->_spellCheck->setReload($value);
$this->assertEquals(
$value,
$this->_spellCheck->getReload()
);
}
public function testSetAndGetDictionary()
{
$value = 'myDictionary';
$this->_spellCheck->setDictionary($value);
$this->assertEquals(
$value,
$this->_spellCheck->getDictionary()
);
}
public function testSetAndGetCount()
{
$value = 11;
$this->_spellCheck->setCount($value);
$this->assertEquals(
$value,
$this->_spellCheck->getCount()
);
}
public function testSetAndGetOnlyMorePopular()
{
$value = false;
$this->_spellCheck->setOnlyMorePopular($value);
$this->assertEquals(
$value,
$this->_spellCheck->getOnlyMorePopular()
);
}
public function testSetAndGetExtendedResults()
{
$value = false;
$this->_spellCheck->setExtendedResults($value);
$this->assertEquals(
$value,
$this->_spellCheck->getExtendedResults()
);
}
public function testSetAndGetCollate()
{
$value = false;
$this->_spellCheck->setCollate($value);
$this->assertEquals(
$value,
$this->_spellCheck->getCollate()
);
}
public function testSetAndGetMaxCollations()
{
$value = 23;
$this->_spellCheck->setMaxCollations($value);
$this->assertEquals(
$value,
$this->_spellCheck->getMaxCollations()
);
}
public function testSetAndGetMaxCollationTries()
{
$value = 10;
$this->_spellCheck->setMaxCollationTries($value);
$this->assertEquals(
$value,
$this->_spellCheck->getMaxCollationTries()
);
}
public function testSetAndGetMaxCollationEvaluations()
{
$value = 10;
$this->_spellCheck->setMaxCollationEvaluations($value);
$this->assertEquals(
$value,
$this->_spellCheck->getMaxCollationEvaluations()
);
}
public function testSetAndGetCollateExtendedResults()
{
$value = true;
$this->_spellCheck->setCollateExtendedResults($value);
$this->assertEquals(
$value,
$this->_spellCheck->getCollateExtendedResults()
);
}
public function testSetAndGetAccuracy()
{
$value = .1;
$this->_spellCheck->setAccuracy($value);
$this->assertEquals(
$value,
$this->_spellCheck->getAccuracy()
);
}
}
...@@ -210,75 +210,6 @@ class Solarium_Query_SelectTest extends PHPUnit_Framework_TestCase ...@@ -210,75 +210,6 @@ class Solarium_Query_SelectTest extends PHPUnit_Framework_TestCase
); );
} }
public function testAddShard()
{
$this->_query->addShard('shard1', 'localhost:8983/solr/shard1');
$shards = $this->_query->getShards();
$this->assertEquals(
'localhost:8983/solr/shard1',
$shards['shard1']
);
}
public function testRemoveShard()
{
$this->_query->addShard('shard1', 'localhost:8983/solr/shard1');
$this->_query->removeShard('shard1');
$shards = $this->_query->getShards();
$this->assertFalse(isset($shards['shard1']));
}
public function testClearShards()
{
$this->_query->addShards(array(
'shard1' => 'localhost:8983/solr/shard1',
'shard2' => 'localhost:8983/solr/shard2',
));
$this->_query->clearShards();
$shards = $this->_query->getShards();
$this->assertTrue(is_array($shards));
$this->assertEquals(0, count($shards));
}
public function testAddShards()
{
$shards = array(
'shard1' => 'localhost:8983/solr/shard1',
'shard2' => 'localhost:8983/solr/shard2',
);
$this->_query->addShards($shards);
$this->assertEquals($shards, $this->_query->getShards());
}
public function testSetShards()
{
$this->_query->addShards(array(
'shard1' => 'localhost:8983/solr/shard1',
'shard2' => 'localhost:8983/solr/shard2',
));
$this->_query->setShards(array(
'shard3' => 'localhost:8983/solr/shard3',
'shard4' => 'localhost:8983/solr/shard4',
'shard5' => 'localhost:8983/solr/shard5',
));
$shards = $this->_query->getShards();
$this->assertEquals(3, count($shards));
$this->assertEquals(array(
'shard3' => 'localhost:8983/solr/shard3',
'shard4' => 'localhost:8983/solr/shard4',
'shard5' => 'localhost:8983/solr/shard5',
), $shards);
}
public function testSetShardRequestHandler()
{
$this->_query->setShardRequestHandler('dummy');
$this->assertEquals(
'dummy',
$this->_query->getShardRequestHandler()
);
}
public function testAddAndGetFilterQuery() public function testAddAndGetFilterQuery()
{ {
$fq = new Solarium_Query_Select_FilterQuery; $fq = new Solarium_Query_Select_FilterQuery;
...@@ -464,10 +395,6 @@ class Solarium_Query_SelectTest extends PHPUnit_Framework_TestCase ...@@ -464,10 +395,6 @@ class Solarium_Query_SelectTest extends PHPUnit_Framework_TestCase
'fields' => array('id','title','category'), 'fields' => array('id','title','category'),
'rows' => 100, 'rows' => 100,
'start' => 200, 'start' => 200,
'shards' => array(
'shard1' => 'localhost:8983/solr/shard1',
'shard2' => 'localhost:8983/solr/shard2',
),
'filterquery' => array( 'filterquery' => array(
array('key' => 'pub', 'tag' => array('pub'),'query' => 'published:true'), array('key' => 'pub', 'tag' => array('pub'),'query' => 'published:true'),
'online' => array('tag' => 'onl','query' => 'online:true') 'online' => array('tag' => 'onl','query' => 'online:true')
...@@ -490,7 +417,6 @@ class Solarium_Query_SelectTest extends PHPUnit_Framework_TestCase ...@@ -490,7 +417,6 @@ class Solarium_Query_SelectTest extends PHPUnit_Framework_TestCase
$this->assertEquals($config['fields'], $query->getFields()); $this->assertEquals($config['fields'], $query->getFields());
$this->assertEquals($config['rows'], $query->getRows()); $this->assertEquals($config['rows'], $query->getRows());
$this->assertEquals($config['start'], $query->getStart()); $this->assertEquals($config['start'], $query->getStart());
$this->assertEquals($config['shards'], $query->getShards());
$this->assertEquals($config['documentclass'], $query->getDocumentClass()); $this->assertEquals($config['documentclass'], $query->getDocumentClass());
$this->assertEquals($config['resultclass'], $query->getResultClass()); $this->assertEquals($config['resultclass'], $query->getResultClass());
$this->assertEquals('published:true', $query->getFilterQuery('pub')->getQuery()); $this->assertEquals('published:true', $query->getFilterQuery('pub')->getQuery());
...@@ -665,4 +591,14 @@ class Solarium_Query_SelectTest extends PHPUnit_Framework_TestCase ...@@ -665,4 +591,14 @@ class Solarium_Query_SelectTest extends PHPUnit_Framework_TestCase
get_class($spellcheck) get_class($spellcheck)
); );
} }
public function testGetDistributedSearch()
{
$spellcheck = $this->_query->getDistributedSearch();
$this->assertEquals(
'Solarium_Query_Select_Component_DistributedSearch',
get_class($spellcheck)
);
}
} }
...@@ -52,12 +52,14 @@ class Solarium_Result_SelectTest extends PHPUnit_Framework_TestCase ...@@ -52,12 +52,14 @@ class Solarium_Result_SelectTest extends PHPUnit_Framework_TestCase
$this->_moreLikeThis = 'dummy-facetset-value'; $this->_moreLikeThis = 'dummy-facetset-value';
$this->_highlighting = 'dummy-highlighting-value'; $this->_highlighting = 'dummy-highlighting-value';
$this->_grouping = 'dummy-grouping-value'; $this->_grouping = 'dummy-grouping-value';
$this->_spellcheck = 'dummy-grouping-value';
$this->_components = array( $this->_components = array(
Solarium_Query_Select::COMPONENT_FACETSET => $this->_facetSet, Solarium_Query_Select::COMPONENT_FACETSET => $this->_facetSet,
Solarium_Query_Select::COMPONENT_MORELIKETHIS => $this->_moreLikeThis, Solarium_Query_Select::COMPONENT_MORELIKETHIS => $this->_moreLikeThis,
Solarium_Query_Select::COMPONENT_HIGHLIGHTING => $this->_highlighting, Solarium_Query_Select::COMPONENT_HIGHLIGHTING => $this->_highlighting,
Solarium_Query_Select::COMPONENT_GROUPING => $this->_grouping Solarium_Query_Select::COMPONENT_GROUPING => $this->_grouping,
Solarium_Query_Select::COMPONENT_SPELLCHECK => $this->_spellcheck,
); );
$this->_result = new Solarium_Result_SelectDummy(1, 12, $this->_numFound, $this->_docs, $this->_components); $this->_result = new Solarium_Result_SelectDummy(1, 12, $this->_numFound, $this->_docs, $this->_components);
...@@ -128,6 +130,14 @@ class Solarium_Result_SelectTest extends PHPUnit_Framework_TestCase ...@@ -128,6 +130,14 @@ class Solarium_Result_SelectTest extends PHPUnit_Framework_TestCase
); );
} }
public function testGetSpellcheck()
{
$this->assertEquals(
$this->_components[Solarium_Query_Select::COMPONENT_SPELLCHECK],
$this->_result->getSpellcheck()
);
}
public function testIterator() public function testIterator()
{ {
$docs = array(); $docs = array();
...@@ -154,7 +164,7 @@ class Solarium_Result_SelectTest extends PHPUnit_Framework_TestCase ...@@ -154,7 +164,7 @@ class Solarium_Result_SelectTest extends PHPUnit_Framework_TestCase
$this->_result->getQueryTime() $this->_result->getQueryTime()
); );
} }
} }
class Solarium_Result_SelectDummy extends Solarium_Result_Select class Solarium_Result_SelectDummy extends Solarium_Result_Select
......
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