Commit 84b4ed17 authored by Markus Kalkbrenner's avatar Markus Kalkbrenner Committed by GitHub

prepare that (some) components could be reused by other query types than select (#541)

parent 4b1fb0b0
......@@ -38,12 +38,12 @@
* @namespace
*/
namespace Solarium\QueryType\Select\Query\Component;
namespace Solarium\Component;
use Solarium\Core\Configurable;
use Solarium\Core\Query\AbstractQuery;
use Solarium\QueryType\Select\ResponseParser\Component\ComponentParserInterface;
use Solarium\QueryType\Select\RequestBuilder\Component\ComponentRequestBuilderInterface;
use Solarium\Component\ComponentParserInterface;
use Solarium\Component\ComponentRequestBuilderInterface;
/**
* Query component base class.
......
<?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/
*/
/**
* @namespace
*/
namespace Solarium\Component;
use Solarium\Core\Query\AbstractQuery;
use Solarium\Exception\OutOfBoundsException;
/**
* Base class for all query types supporting components, not intended for direct usage.
*/
abstract class AbstractComponentAwareQuery extends AbstractQuery
{
/**
* Query component morelikethis.
*/
const COMPONENT_MORELIKETHIS = 'morelikethis';
/**
* Query component spellcheck.
*/
const COMPONENT_SPELLCHECK = 'spellcheck';
/**
* Query component spellcheck.
*/
const COMPONENT_SUGGESTER = 'suggest';
/**
* Query component debug.
*/
const COMPONENT_DEBUG = 'debug';
/**
* Query component spatial.
*/
const COMPONENT_SPATIAL = 'spatial';
/**
* Search components.
*
* @var AbstractComponent[]
*/
protected $components = array();
/**
* Default select query component types.
*
* @var array
*/
protected $componentTypes = array(
self::COMPONENT_MORELIKETHIS => 'Solarium\Component\MoreLikeThis',
self::COMPONENT_SPELLCHECK => 'Solarium\Component\Spellcheck',
self::COMPONENT_SUGGESTER => 'Solarium\Component\Suggester',
self::COMPONENT_DEBUG => 'Solarium\Component\Debug',
self::COMPONENT_SPATIAL => 'Solarium\Component\Spatial',
);
/**
* Get all registered component types.
*
* @return array
*/
public function getComponentTypes()
{
return $this->componentTypes;
}
/**
* Register a component type.
*
* @param string $key
* @param string $component
*
* @return self Provides fluent interface
*/
public function registerComponentType($key, $component)
{
$this->componentTypes[$key] = $component;
return $this;
}
/**
* Get all registered components.
*
* @return AbstractComponent[]
*/
public function getComponents()
{
return $this->components;
}
/**
* Get a component instance by key.
*
* You can optionally supply an autoload class to create a new component
* instance if there is no registered component for the given key yet.
*
* @throws OutOfBoundsException
*
* @param string $key Use one of the constants
* @param string|boolean $autoload Class to autoload if component needs to be created
* @param array|null $config Configuration to use for autoload
*
* @return object|null
*/
public function getComponent($key, $autoload = false, $config = null)
{
if (isset($this->components[$key])) {
return $this->components[$key];
} else {
if ($autoload === true) {
if (!isset($this->componentTypes[$key])) {
throw new OutOfBoundsException('Cannot autoload unknown component: '.$key);
}
$className = $this->componentTypes[$key];
$className = class_exists($className) ? $className : $className.strrchr($className, '\\');
$component = new $className($config);
$this->setComponent($key, $component);
return $component;
}
return;
}
}
/**
* Set a component instance.
*
* This overwrites any existing component registered with the same key.
*
* @param string $key
* @param AbstractComponent $component
*
* @return self Provides fluent interface
*/
public function setComponent($key, $component)
{
$component->setQueryInstance($this);
$this->components[$key] = $component;
return $this;
}
/**
* Remove a component instance.
*
* You can remove a component by passing its key or the component instance.
*
* @param string|AbstractComponent $component
*
* @return self Provides fluent interface
*/
public function removeComponent($component)
{
if (is_object($component)) {
foreach ($this->components as $key => $instance) {
if ($instance === $component) {
unset($this->components[$key]);
break;
}
}
} else {
if (isset($this->components[$component])) {
unset($this->components[$component]);
}
}
return $this;
}
/**
* Build component instances based on config.
*
* @param array $configs
*/
protected function createComponents($configs)
{
foreach ($configs as $type => $config) {
$this->getComponent($type, true, $config);
}
}
/**
* Get a MoreLikeThis component instance.
*
* This is a convenience method that maps presets to getComponent
*
* @return \Solarium\Component\MoreLikeThis
*/
public function getMoreLikeThis()
{
return $this->getComponent(self::COMPONENT_MORELIKETHIS, true);
}
/**
* Get a spellcheck component instance.
*
* This is a convenience method that maps presets to getComponent
*
* @return \Solarium\Component\Spellcheck
*/
public function getSpellcheck()
{
return $this->getComponent(self::COMPONENT_SPELLCHECK, true);
}
/**
* Get a suggest component instance.
*
* This is a convenience method that maps presets to getComponent
*
* @return \Solarium\Component\Spellcheck
*/
public function getSuggester()
{
return $this->getComponent(self::COMPONENT_SUGGESTER, true);
}
/**
* Get a Debug component instance.
*
* This is a convenience method that maps presets to getComponent
*
* @return \Solarium\Component\Debug
*/
public function getDebug()
{
return $this->getComponent(self::COMPONENT_DEBUG, true);
}
/**
* Get a Spatial component instance.
*
* This is a convenience method that maps presets to getComponent
*
* @return \Solarium\Component\Spatial
*/
public function getSpatial()
{
return $this->getComponent(self::COMPONENT_SPATIAL, true);
}
}
......@@ -38,11 +38,10 @@
* @namespace
*/
namespace Solarium\QueryType\Select\Query\Component;
namespace Solarium\Component;
use Solarium\QueryType\Select\Query\Query as SelectQuery;
use Solarium\QueryType\Select\RequestBuilder\Component\Debug as RequestBuilder;
use Solarium\QueryType\Select\ResponseParser\Component\Debug as ResponseParser;
use Solarium\Component\RequestBuilder\Debug as RequestBuilder;
use Solarium\Component\ResponseParser\Debug as ResponseParser;
/**
* Debug component.
......@@ -58,7 +57,7 @@ class Debug extends AbstractComponent
*/
public function getType()
{
return SelectQuery::COMPONENT_DEBUG;
return AbstractComponentAwareQuery::COMPONENT_DEBUG;
}
/**
......
......@@ -38,11 +38,10 @@
* @namespace
*/
namespace Solarium\QueryType\Select\Query\Component;
namespace Solarium\Component;
use Solarium\QueryType\Select\Query\Query as SelectQuery;
use Solarium\QueryType\Select\RequestBuilder\Component\MoreLikeThis as RequestBuilder;
use Solarium\QueryType\Select\ResponseParser\Component\MoreLikeThis as ResponseParser;
use Solarium\Component\RequestBuilder\MoreLikeThis as RequestBuilder;
use Solarium\Component\ResponseParser\MoreLikeThis as ResponseParser;
/**
* MoreLikeThis component.
......@@ -58,7 +57,7 @@ class MoreLikeThis extends AbstractComponent
*/
public function getType()
{
return SelectQuery::COMPONENT_MORELIKETHIS;
return AbstractComponentAwareQuery::COMPONENT_MORELIKETHIS;
}
/**
......
......@@ -38,9 +38,9 @@
* @namespace
*/
namespace Solarium\QueryType\Select\RequestBuilder\Component;
namespace Solarium\Component\RequestBuilder;
use Solarium\QueryType\Select\Query\Component\AbstractComponent;
use Solarium\Component\AbstractComponent;
use Solarium\Core\Client\Request;
/**
......
......@@ -38,9 +38,9 @@
* @namespace
*/
namespace Solarium\QueryType\Select\RequestBuilder\Component;
namespace Solarium\Component\RequestBuilder;
use Solarium\QueryType\Select\Query\Component\Debug as DebugComponent;
use Solarium\Component\Debug as DebugComponent;
use Solarium\Core\Client\Request;
/**
......
......@@ -38,9 +38,9 @@
* @namespace
*/
namespace Solarium\QueryType\Select\RequestBuilder\Component;
namespace Solarium\Component\RequestBuilder;
use Solarium\QueryType\Select\Query\Component\MoreLikeThis as MoreLikeThisComponent;
use Solarium\Component\MoreLikeThis as MoreLikeThisComponent;
use Solarium\Core\Client\Request;
/**
......
<?php
namespace Solarium\QueryType\Select\RequestBuilder\Component;
namespace Solarium\Component\RequestBuilder;
use Solarium\QueryType\Select\Query\Component\Spatial as SpatialComponent;
use Solarium\Component\Spatial as SpatialComponent;
use Solarium\Core\Client\Request;
/**
......
......@@ -34,13 +34,9 @@
* @link http://www.solarium-project.org/
*/
/**
* @namespace
*/
namespace Solarium\QueryType\Select\RequestBuilder\Component;
namespace Solarium\Component\RequestBuilder;
use Solarium\QueryType\Select\Query\Component\Spellcheck as SpellcheckComponent;
use Solarium\Component\Spellcheck as SpellcheckComponent;
use Solarium\Core\Client\Request;
/**
......
......@@ -38,9 +38,9 @@
* @namespace
*/
namespace Solarium\QueryType\Select\ResponseParser\Component;
namespace Solarium\Component\ResponseParser;
use Solarium\QueryType\Select\Query\Query;
use Solarium\Core\Query\AbstractQuery;
/**
* ComponentParserInterface.
......@@ -50,9 +50,9 @@ interface ComponentParserInterface
/**
* Parse result data into result objects.
*
* @param Query $query
* @param object $component
* @param array $data
* @param AbstractQuery $query
* @param object $component
* @param array $data
*
* @return object|null
*/
......
......@@ -38,16 +38,16 @@
* @namespace
*/
namespace Solarium\QueryType\Select\ResponseParser\Component;
namespace Solarium\Component\ResponseParser;
use Solarium\QueryType\Select\Query\Query;
use Solarium\QueryType\Select\Query\Component\Debug as DebugComponent;
use Solarium\QueryType\Select\Result\Debug\Result;
use Solarium\QueryType\Select\Result\Debug\DocumentSet;
use Solarium\QueryType\Select\Result\Debug\Timing;
use Solarium\QueryType\Select\Result\Debug\Detail;
use Solarium\QueryType\Select\Result\Debug\Document;
use Solarium\QueryType\Select\Result\Debug\TimingPhase;
use Solarium\Component\Debug as DebugComponent;
use Solarium\Component\Result\Debug\Result;
use Solarium\Component\Result\Debug\DocumentSet;
use Solarium\Component\Result\Debug\Timing;
use Solarium\Component\Result\Debug\Detail;
use Solarium\Component\Result\Debug\Document;
use Solarium\Component\Result\Debug\TimingPhase;
/**
* Parse select component Debug result from the data.
......
......@@ -38,12 +38,12 @@
* @namespace
*/
namespace Solarium\QueryType\Select\ResponseParser\Component;
namespace Solarium\Component\ResponseParser;
use Solarium\QueryType\Select\Query\Query;
use Solarium\QueryType\Select\Query\Component\MoreLikeThis as MoreLikeThisComponent;
use Solarium\QueryType\Select\Result\MoreLikeThis\Result;
use Solarium\QueryType\Select\Result\MoreLikeThis\MoreLikeThis as MoreLikeThisResult;
use Solarium\QueryType\Analysis\Query\AbstractQuery;
use Solarium\Component\MoreLikeThis as MoreLikeThisComponent;
use Solarium\Component\Result\MoreLikeThis\Result;
use Solarium\Component\Result\MoreLikeThis\MoreLikeThis as MoreLikeThisResult;
/**
* Parse select component MoreLikeThis result from the data.
......@@ -53,7 +53,7 @@ class MoreLikeThis implements ComponentParserInterface
/**
* Parse result data into result objects.
*
* @param Query $query
* @param AbstractQuery $query
* @param MoreLikeThisComponent $moreLikeThis
* @param array $data
*
......
......@@ -38,14 +38,14 @@
* @namespace
*/
namespace Solarium\QueryType\Select\ResponseParser\Component;
use Solarium\QueryType\Select\Query\Query;
use Solarium\QueryType\Select\Query\Component\Spellcheck as SpellcheckComponent;
use Solarium\QueryType\Select\Result\Spellcheck as SpellcheckResult;
use Solarium\QueryType\Select\Result\Spellcheck\Result;
use Solarium\QueryType\Select\Result\Spellcheck\Collation;
use Solarium\QueryType\Select\Result\Spellcheck\Suggestion;
namespace Solarium\Component\ResponseParser;
use Solarium\Core\Query\AbstractQuery;
use Solarium\Component\Spellcheck as SpellcheckComponent;
use Solarium\Component\Result\Spellcheck as SpellcheckResult;
use Solarium\Component\Result\Spellcheck\Result;
use Solarium\Component\Result\Spellcheck\Collation;
use Solarium\Component\Result\Spellcheck\Suggestion;
use Solarium\Core\Query\AbstractResponseParser as ResponseParserAbstract;
/**
......@@ -56,7 +56,7 @@ class Spellcheck extends ResponseParserAbstract implements ComponentParserInterf
/**
* Parse result data into result objects.
*
* @param Query $query
* @param AbstractQuery $query
* @param SpellcheckComponent $spellcheck
* @param array $data
*
......@@ -123,7 +123,7 @@ class Spellcheck extends ResponseParserAbstract implements ComponentParserInterf
/**
* Parse collation data into a result object.
*
* @param Query $queryObject
* @param AbstractQuery $queryObject
* @param array $values
*
* @return Collation[]
......
......@@ -38,7 +38,7 @@
* @namespace
*/
namespace Solarium\QueryType\Select\Result\Debug;
namespace Solarium\Component\Result\Debug;
/**
* Select component debug detail result.
......
......@@ -38,7 +38,7 @@
* @namespace
*/
namespace Solarium\QueryType\Select\Result\Debug;
namespace Solarium\Component\Result\Debug;
/**
* Select component debug document result.
......
......@@ -38,7 +38,7 @@
* @namespace
*/
namespace Solarium\QueryType\Select\Result\Debug;
namespace Solarium\Component\Result\Debug;
/**
* Select component debug documentset result.
......
......@@ -38,7 +38,7 @@
* @namespace
*/
namespace Solarium\QueryType\Select\Result\Debug;
namespace Solarium\Component\Result\Debug;
/**
* Select component debug result.
......
......@@ -38,7 +38,7 @@
* @namespace
*/
namespace Solarium\QueryType\Select\Result\Debug;
namespace Solarium\Component\Result\Debug;
/**
* Select component debug timing result.
......
......@@ -38,7 +38,7 @@
* @namespace
*/
namespace Solarium\QueryType\Select\Result\Debug;
namespace Solarium\Component\Result\Debug;
/**
* Select component debug timing phase result.
......
......@@ -38,7 +38,7 @@
* @namespace
*/
namespace Solarium\QueryType\Select\Result\MoreLikeThis;
namespace Solarium\Component\Result\MoreLikeThis;
/**
* Select component morelikethis result.
......
......@@ -38,7 +38,7 @@
* @namespace
*/
namespace Solarium\QueryType\Select\Result\MoreLikeThis;
namespace Solarium\Component\Result\MoreLikeThis;
use Solarium\QueryType\Select\Result\DocumentInterface;
......
......@@ -38,7 +38,7 @@
* @namespace
*/
namespace Solarium\QueryType\Select\Result\Spellcheck;
namespace Solarium\Component\Result\Spellcheck;
/**
* Select component spellcheck collation result.
......
......@@ -38,7 +38,7 @@
* @namespace
*/
namespace Solarium\QueryType\Select\Result\Spellcheck;
namespace Solarium\Component\Result\Spellcheck;
/**
* Select component spellcheck result.
......
......@@ -38,7 +38,7 @@
* @namespace
*/
namespace Solarium\QueryType\Select\Result\Spellcheck;
namespace Solarium\Component\Result\Spellcheck;
/**
* Select component spellcheck suggestion result.
......
<?php
namespace Solarium\QueryType\Select\Query\Component;
namespace Solarium\Component;
use Solarium\QueryType\Select\Query\Query as SelectQuery;
use Solarium\QueryType\Select\RequestBuilder\Component\Spatial as RequestBuilder;
use Solarium\Component\RequestBuilder\Spatial as RequestBuilder;
/**
* Spatial component.
......@@ -19,7 +18,7 @@ class Spatial extends AbstractComponent
*/
public function getType()
{
return SelectQuery::COMPONENT_SPATIAL;
return AbstractComponentAwareQuery::COMPONENT_SPATIAL;
}
/**
......
......@@ -38,11 +38,10 @@
* @namespace
*/
namespace Solarium\QueryType\Select\Query\Component;
namespace Solarium\Component;
use Solarium\QueryType\Select\Query\Query as SelectQuery;
use Solarium\QueryType\Select\RequestBuilder\Component\Spellcheck as RequestBuilder;
use Solarium\QueryType\Select\ResponseParser\Component\Spellcheck as ResponseParser;
use Solarium\Component\RequestBuilder\Spellcheck as RequestBuilder;
use Solarium\Component\ResponseParser\Spellcheck as ResponseParser;
use Solarium\QueryType\Spellcheck\QueryTrait;
/**
......@@ -62,7 +61,7 @@ class Spellcheck extends AbstractComponent
*/
public function getType()
{
return SelectQuery::COMPONENT_SPELLCHECK;
return AbstractComponentAwareQuery::COMPONENT_SPELLCHECK;
}
/**
......
......@@ -38,11 +38,10 @@
* @namespace
*/
namespace Solarium\QueryType\Select\Query\Component;
namespace Solarium\Component;
use Solarium\QueryType\Select\Query\Query as SelectQuery;
use Solarium\QueryType\Select\RequestBuilder\Component\Spellcheck as RequestBuilder;
use Solarium\QueryType\Select\ResponseParser\Component\Spellcheck as ResponseParser;
use Solarium\Component\RequestBuilder\Spellcheck as RequestBuilder;
use Solarium\Component\ResponseParser\Spellcheck as ResponseParser;
use Solarium\QueryType\Suggester\QueryTrait;
/**
......@@ -61,7 +60,7 @@ class Suggester extends AbstractComponent
*/
public function getType()
{
return SelectQuery::COMPONENT_SUGGESTER;
return AbstractComponentAwareQuery::COMPONENT_SUGGESTER;
}
/**
......
......@@ -40,6 +40,7 @@
namespace Solarium\QueryType\Select\Query\Component;
use Solarium\Component\AbstractComponent;
use Solarium\Exception\InvalidArgumentException;
use Solarium\QueryType\Select\Query\Query as SelectQuery;
use Solarium\QueryType\Select\RequestBuilder\Component\DisMax as RequestBuilder;
......
......@@ -40,6 +40,7 @@
namespace Solarium\QueryType\Select\Query\Component;
use Solarium\Component\AbstractComponent;
use Solarium\QueryType\Select\Query\Query as SelectQuery;
use Solarium\QueryType\Select\RequestBuilder\Component\DistributedSearch as RequestBuilder;
......
......@@ -40,6 +40,7 @@
namespace Solarium\QueryType\Select\Query\Component;
use Solarium\Component\AbstractComponent;
use Solarium\QueryType\Select\Query\Query as SelectQuery;
use Solarium\QueryType\Select\RequestBuilder\Component\FacetSet as RequestBuilder;
use Solarium\QueryType\Select\ResponseParser\Component\FacetSet as ResponseParser;
......
......@@ -40,6 +40,7 @@
namespace Solarium\QueryType\Select\Query\Component;
use Solarium\Component\AbstractComponent;
use Solarium\QueryType\Select\Query\Query as SelectQuery;
use Solarium\QueryType\Select\RequestBuilder\Component\Grouping as RequestBuilder;
use Solarium\QueryType\Select\ResponseParser\Component\Grouping as ResponseParser;
......
......@@ -41,7 +41,7 @@
namespace Solarium\QueryType\Select\Query\Component\Highlighting;
use Solarium\QueryType\Select\Query\Query as SelectQuery;
use Solarium\QueryType\Select\Query\Component\AbstractComponent;
use Solarium\Component\AbstractComponent;
use Solarium\QueryType\Select\RequestBuilder\Component\Highlighting as RequestBuilder;
use Solarium\QueryType\Select\ResponseParser\Component\Highlighting as ResponseParser;
use Solarium\Exception\InvalidArgumentException;
......
......@@ -41,7 +41,7 @@
namespace Solarium\QueryType\Select\Query\Component\Stats;
use Solarium\QueryType\Select\Query\Query as SelectQuery;
use Solarium\QueryType\Select\Query\Component\AbstractComponent;
use Solarium\Component\AbstractComponent;
use Solarium\QueryType\Select\RequestBuilder\Component\Stats as RequestBuilder;
use Solarium\QueryType\Select\ResponseParser\Component\Stats as ResponseParser;
use Solarium\Exception\InvalidArgumentException;
......
......@@ -40,13 +40,11 @@
namespace Solarium\QueryType\Select\Query;
use Solarium\Component\AbstractComponentAwareQuery;
use Solarium\Core\Client\Client;
use Solarium\Core\Query\AbstractQuery as BaseQuery;
use Solarium\QueryType\Select\RequestBuilder\RequestBuilder;
use Solarium\QueryType\Select\ResponseParser\ResponseParser;
use Solarium\Exception\InvalidArgumentException;
use Solarium\Exception\OutOfBoundsException;
use Solarium\QueryType\Select\Query\Component\AbstractComponent as AbstractComponent;
/**
* Select Query.
......@@ -55,7 +53,7 @@ use Solarium\QueryType\Select\Query\Component\AbstractComponent as AbstractCompo
* lots of options and there are many Solarium subclasses for it.
* See the Solr documentation and the relevant Solarium classes for more info.
*/
class Query extends BaseQuery
class Query extends AbstractComponentAwareQuery
{
/**
* Solr sort mode descending.
......@@ -92,26 +90,11 @@ class Query extends BaseQuery
*/
const COMPONENT_EDISMAX = 'edismax';
/**
* Query component morelikethis.
*/
const COMPONENT_MORELIKETHIS = 'morelikethis';
/**
* Query component highlighting.
*/
const COMPONENT_HIGHLIGHTING = 'highlighting';
/**
* Query component spellcheck.
*/
const COMPONENT_SPELLCHECK = 'spellcheck';
/**
* Query component spellcheck.
*/
const COMPONENT_SUGGESTER = 'suggest';
/**
* Query component grouping.
*/
......@@ -127,16 +110,6 @@ class Query extends BaseQuery
*/
const COMPONENT_STATS = 'stats';
/**
* Query component debug.
*/
const COMPONENT_DEBUG = 'debug';
/**
* Query component spatial.
*/
const COMPONENT_SPATIAL = 'spatial';
/**
* Default options.
*
......@@ -169,14 +142,15 @@ class Query extends BaseQuery
self::COMPONENT_FACETSET => 'Solarium\QueryType\Select\Query\Component\FacetSet',
self::COMPONENT_DISMAX => 'Solarium\QueryType\Select\Query\Component\DisMax',
self::COMPONENT_EDISMAX => 'Solarium\QueryType\Select\Query\Component\EdisMax',
self::COMPONENT_MORELIKETHIS => 'Solarium\QueryType\Select\Query\Component\MoreLikeThis',
parent::COMPONENT_MORELIKETHIS => 'Solarium\Component\MoreLikeThis',
self::COMPONENT_HIGHLIGHTING => 'Solarium\QueryType\Select\Query\Component\Highlighting\Highlighting',
self::COMPONENT_GROUPING => 'Solarium\QueryType\Select\Query\Component\Grouping',
self::COMPONENT_SPELLCHECK => 'Solarium\QueryType\Select\Query\Component\Spellcheck',
parent::COMPONENT_SPELLCHECK => 'Solarium\Component\Spellcheck',
parent::COMPONENT_SUGGESTER => 'Solarium\Component\Suggester',
self::COMPONENT_DISTRIBUTEDSEARCH => 'Solarium\QueryType\Select\Query\Component\DistributedSearch',
self::COMPONENT_STATS => 'Solarium\QueryType\Select\Query\Component\Stats\Stats',
self::COMPONENT_DEBUG => 'Solarium\QueryType\Select\Query\Component\Debug',
self::COMPONENT_SPATIAL => 'Solarium\QueryType\Select\Query\Component\Spatial',
parent::COMPONENT_DEBUG => 'Solarium\Component\Debug',
parent::COMPONENT_SPATIAL => 'Solarium\Component\Spatial',
);
/**
......@@ -200,13 +174,6 @@ class Query extends BaseQuery
*/
protected $filterQueries = array();
/**
* Search components.
*
* @var AbstractComponent[]
*/
protected $components = array();
/**
* Get type for this query.
*
......@@ -748,134 +715,6 @@ class Query extends BaseQuery
$this->addFilterQueries($filterQueries);
}
/**
* Get all registered component types.
*
* @return array
*/
public function getComponentTypes()
{
return $this->componentTypes;
}
/**
* Register a component type.
*
* @param string $key
* @param string $component
*
* @return self Provides fluent interface
*/
public function registerComponentType($key, $component)
{
$this->componentTypes[$key] = $component;
return $this;
}
/**
* Get all registered components.
*
* @return AbstractComponent[]
*/
public function getComponents()
{
return $this->components;
}
/**
* Get a component instance by key.
*
* You can optionally supply an autoload class to create a new component
* instance if there is no registered component for the given key yet.
*
* @throws OutOfBoundsException
*
* @param string $key Use one of the constants
* @param string|boolean $autoload Class to autoload if component needs to be created
* @param array|null $config Configuration to use for autoload
*
* @return object|null
*/
public function getComponent($key, $autoload = false, $config = null)
{
if (isset($this->components[$key])) {
return $this->components[$key];
} else {
if ($autoload === true) {
if (!isset($this->componentTypes[$key])) {
throw new OutOfBoundsException('Cannot autoload unknown component: '.$key);
}
$className = $this->componentTypes[$key];
$className = class_exists($className) ? $className : $className.strrchr($className, '\\');
$component = new $className($config);
$this->setComponent($key, $component);
return $component;
}
return;
}
}
/**
* Set a component instance.
*
* This overwrites any existing component registered with the same key.
*
* @param string $key
* @param AbstractComponent $component
*
* @return self Provides fluent interface
*/
public function setComponent($key, $component)
{
$component->setQueryInstance($this);
$this->components[$key] = $component;
return $this;
}
/**
* Remove a component instance.
*
* You can remove a component by passing its key or the component instance.
*
* @param string|AbstractComponent $component
*
* @return self Provides fluent interface
*/
public function removeComponent($component)
{
if (is_object($component)) {
foreach ($this->components as $key => $instance) {
if ($instance === $component) {
unset($this->components[$key]);
break;
}
}
} else {
if (isset($this->components[$component])) {
unset($this->components[$component]);
}
}
return $this;
}
/**
* Get a MoreLikeThis component instance.
*
* This is a convenience method that maps presets to getComponent
*
* @return \Solarium\QueryType\Select\Query\Component\MoreLikeThis
*/
public function getMoreLikeThis()
{
return $this->getComponent(self::COMPONENT_MORELIKETHIS, true);
}
/**
* Get a FacetSet component instance.
*
......@@ -936,18 +775,6 @@ class Query extends BaseQuery
return $this->getComponent(self::COMPONENT_GROUPING, true);
}
/**
* Get a spellcheck component instance.
*
* This is a convenience method that maps presets to getComponent
*
* @return \Solarium\QueryType\Select\Query\Component\Spellcheck
*/
public function getSpellcheck()
{
return $this->getComponent(self::COMPONENT_SPELLCHECK, true);
}
/**
* Get a DistributedSearch component instance.
*
......@@ -972,18 +799,6 @@ class Query extends BaseQuery
return $this->getComponent(self::COMPONENT_STATS, true);
}
/**
* Get a Debug component instance.
*
* This is a convenience method that maps presets to getComponent
*
* @return \Solarium\QueryType\Select\Query\Component\Debug
*/
public function getDebug()
{
return $this->getComponent(self::COMPONENT_DEBUG, true);
}
/**
* Add a tag.
*
......@@ -1068,18 +883,6 @@ class Query extends BaseQuery
return $this->addTags($tags);
}
/**
* Get a Spatial component instance.
*
* This is a convenience method that maps presets to getComponent
*
* @return \Solarium\QueryType\Select\Query\Component\Spatial
*/
public function getSpatial()
{
return $this->getComponent(self::COMPONENT_SPATIAL, true);
}
/**
* Set the cursor mark to fetch.
*
......@@ -1158,15 +961,4 @@ class Query extends BaseQuery
}
}
/**
* Build component instances based on config.
*
* @param array $configs
*/
protected function createComponents($configs)
{
foreach ($configs as $type => $config) {
$this->getComponent($type, true, $config);
}
}
}
......@@ -40,6 +40,7 @@
namespace Solarium\QueryType\Select\RequestBuilder\Component;
use Solarium\Component\RequestBuilder\ComponentRequestBuilderInterface;
use Solarium\QueryType\Select\Query\Component\DisMax as DismaxComponent;
use Solarium\Core\Client\Request;
......
......@@ -40,6 +40,7 @@
namespace Solarium\QueryType\Select\RequestBuilder\Component;
use Solarium\Component\RequestBuilder\ComponentRequestBuilderInterface;
use Solarium\QueryType\Select\Query\Component\DistributedSearch as DistributedSearchComponent;
use Solarium\Core\Client\Request;
......
......@@ -40,6 +40,7 @@
namespace Solarium\QueryType\Select\RequestBuilder\Component;
use Solarium\Component\RequestBuilder\ComponentRequestBuilderInterface;
use Solarium\QueryType\Select\Query\Component\EdisMax as EdismaxComponent;
use Solarium\Core\Client\Request;
......
......@@ -40,6 +40,7 @@
namespace Solarium\QueryType\Select\RequestBuilder\Component;
use Solarium\Component\RequestBuilder\ComponentRequestBuilderInterface;
use Solarium\Core\Client\Request;
use Solarium\QueryType\Select\RequestBuilder\RequestBuilder;
use Solarium\QueryType\Select\Query\Component\FacetSet as FacetsetComponent;
......
......@@ -40,6 +40,7 @@
namespace Solarium\QueryType\Select\RequestBuilder\Component;
use Solarium\Component\RequestBuilder\ComponentRequestBuilderInterface;
use Solarium\QueryType\Select\Query\Component\Grouping as GroupingComponent;
use Solarium\Core\Client\Request;
......
......@@ -40,6 +40,7 @@
namespace Solarium\QueryType\Select\RequestBuilder\Component;
use Solarium\Component\RequestBuilder\ComponentRequestBuilderInterface;
use Solarium\QueryType\Select\Query\Component\Highlighting\Highlighting as HighlightingComponent;
use Solarium\QueryType\Select\Query\Component\Highlighting\Field as HighlightingField;
use Solarium\Core\Client\Request;
......
......@@ -40,6 +40,7 @@
namespace Solarium\QueryType\Select\RequestBuilder\Component;
use Solarium\Component\RequestBuilder\ComponentRequestBuilderInterface;
use Solarium\QueryType\Select\Query\Component\Stats\Stats as StatsComponent;
use Solarium\Core\Client\Request;
......
......@@ -40,6 +40,7 @@
namespace Solarium\QueryType\Select\ResponseParser\Component;
use Solarium\Component\ResponseParser\ComponentParserInterface;
use Solarium\QueryType\Select\Query\Query;
use Solarium\QueryType\Select\Query\Component\FacetSet as QueryFacetSet;
use Solarium\QueryType\Select\Query\Component\Facet\Field as QueryFacetField;
......@@ -252,7 +253,7 @@ class FacetSet extends ResponseParserAbstract implements ComponentParserInterfac
return new ResultFacetRange($data['counts'], $before, $after, $between, $start, $end, $gap);
}
/**
* Add a facet result for a interval facet
*
......@@ -267,7 +268,7 @@ class FacetSet extends ResponseParserAbstract implements ComponentParserInterfac
if (!isset($data['facet_counts']['facet_intervals'][$key])) {
return null;
}
return new ResultFacetInterval($data['facet_counts']['facet_intervals'][$key]);
}
......
......@@ -40,6 +40,7 @@
namespace Solarium\QueryType\Select\ResponseParser\Component;
use Solarium\Component\ResponseParser\ComponentParserInterface;
use Solarium\QueryType\Select\Query\Query;
use Solarium\QueryType\Select\Query\Component\Grouping as GroupingComponent;
use Solarium\QueryType\Select\Result\Grouping\Result;
......
......@@ -40,6 +40,7 @@
namespace Solarium\QueryType\Select\ResponseParser\Component;
use Solarium\Component\ResponseParser\ComponentParserInterface;
use Solarium\QueryType\Select\Query\Query;
use Solarium\QueryType\Select\Query\Component\Highlighting\Highlighting as HighlightingComponent;
use Solarium\QueryType\Select\Result\Highlighting\Highlighting as HighlightingResult;
......
......@@ -40,6 +40,7 @@
namespace Solarium\QueryType\Select\ResponseParser\Component;
use Solarium\Component\ResponseParser\ComponentParserInterface;
use Solarium\QueryType\Select\Query\Query;
use Solarium\QueryType\Select\Query\Component\Stats\Stats as StatsComponent;
use Solarium\QueryType\Select\Result\Stats\Stats as ResultStats;
......
......@@ -29,9 +29,9 @@
* policies, either expressed or implied, of the copyright holder.
*/
namespace Solarium\Tests\QueryType\Select\Query\Component;
namespace Solarium\Tests\Component;
use Solarium\QueryType\Select\Query\Component\AbstractComponent;
use Solarium\Component\AbstractComponent;
use Solarium\QueryType\Select\Query\Query;
class ComponentTest extends \PHPUnit_Framework_TestCase
......
......@@ -29,9 +29,9 @@
* policies, either expressed or implied, of the copyright holder.
*/
namespace Solarium\Tests\QueryType\Select\Result\Debug;
namespace Solarium\Tests\Component\Result\Debug;
use Solarium\QueryType\Select\Result\Debug\Result;
use Solarium\Component\Result\Debug\Result;
class DebugTest extends \PHPUnit_Framework_TestCase
{
......
......@@ -29,9 +29,9 @@
* policies, either expressed or implied, of the copyright holder.
*/
namespace Solarium\Tests\QueryType\Select\Result\Debug;
namespace Solarium\Tests\Component\Result\Debug;
use Solarium\QueryType\Select\Result\Debug\Detail;
use Solarium\Component\Result\Debug\Detail;
class DetailTest extends \PHPUnit_Framework_TestCase
{
......
......@@ -29,9 +29,9 @@
* policies, either expressed or implied, of the copyright holder.
*/
namespace Solarium\Tests\QueryType\Select\Result\Debug;
namespace Solarium\Tests\Component\Result\Debug;
use Solarium\QueryType\Select\Result\Debug\DocumentSet;
use Solarium\Component\Result\Debug\DocumentSet;
class DocumentSetTest extends \PHPUnit_Framework_TestCase
{
......
......@@ -29,9 +29,9 @@
* policies, either expressed or implied, of the copyright holder.
*/
namespace Solarium\Tests\QueryType\Select\Result\Debug;
namespace Solarium\Tests\Component\Result\Debug;
use Solarium\QueryType\Select\Result\Debug\Document;
use Solarium\Component\Result\Debug\Document;
class DocumentTest extends \PHPUnit_Framework_TestCase
{
......
......@@ -29,9 +29,9 @@
* policies, either expressed or implied, of the copyright holder.
*/
namespace Solarium\Tests\QueryType\Select\Result\Debug;
namespace Solarium\Tests\Component\Result\Debug;
use Solarium\QueryType\Select\Result\Debug\TimingPhase;
use Solarium\Component\Result\Debug\TimingPhase;
class TimingPhaseTest extends \PHPUnit_Framework_TestCase
{
......
......@@ -29,9 +29,9 @@
* policies, either expressed or implied, of the copyright holder.
*/
namespace Solarium\Tests\QueryType\Select\Result\Debug;
namespace Solarium\Tests\Component\Result\Debug;
use Solarium\QueryType\Select\Result\Debug\Timing;
use Solarium\Component\Result\Debug\Timing;
class TimingTest extends \PHPUnit_Framework_TestCase
{
......
......@@ -29,11 +29,11 @@
* policies, either expressed or implied, of the copyright holder.
*/
namespace Solarium\Tests\QueryType\Select\Result\MoreLikeThis;
namespace Solarium\Tests\Component\Result\MoreLikeThis;
use Solarium\QueryType\Select\Result\Document;
use Solarium\QueryType\Select\Result\MoreLikeThis\Result;
use Solarium\QueryType\Select\Result\MoreLikeThis\MoreLikeThis;
use Solarium\Component\Result\MoreLikeThis\Result;
use Solarium\Component\Result\MoreLikeThis\MoreLikeThis;
class MoreLikeThisTest extends \PHPUnit_Framework_TestCase
{
......
......@@ -29,10 +29,10 @@
* policies, either expressed or implied, of the copyright holder.
*/
namespace Solarium\Tests\QueryType\Select\Result\MoreLikeThis;
namespace Solarium\Tests\Component\Result\MoreLikeThis;
use Solarium\QueryType\Select\Result\Document;
use Solarium\QueryType\Select\Result\MoreLikeThis\Result;
use Solarium\Component\Result\MoreLikeThis\Result;
class ResultTest extends \PHPUnit_Framework_TestCase
{
......
......@@ -29,9 +29,9 @@
* policies, either expressed or implied, of the copyright holder.
*/
namespace Solarium\Tests\QueryType\Select\Result\Spellcheck;
namespace Solarium\Tests\Component\Result\Spellcheck;
use Solarium\QueryType\Select\Result\Spellcheck\Collation;
use Solarium\Component\Result\Spellcheck\Collation;
class CollationTest extends \PHPUnit_Framework_TestCase
{
......
......@@ -29,9 +29,9 @@
* policies, either expressed or implied, of the copyright holder.
*/
namespace Solarium\Tests\QueryType\Select\Result\Spellcheck;
namespace Solarium\Tests\Component\Result\Spellcheck;
use Solarium\QueryType\Select\Result\Spellcheck\Result;
use Solarium\Component\Result\Spellcheck\Result;
class SpellcheckTest extends \PHPUnit_Framework_TestCase
{
......
......@@ -29,9 +29,9 @@
* policies, either expressed or implied, of the copyright holder.
*/
namespace Solarium\Tests\QueryType\Select\Result\Spellcheck;
namespace Solarium\Tests\Component\Result\Spellcheck;
use Solarium\QueryType\Select\Result\Spellcheck\Suggestion;
use Solarium\Component\Result\Spellcheck\Suggestion;
class SuggestionTest extends \PHPUnit_Framework_TestCase
{
......
......@@ -29,6 +29,14 @@ abstract class AbstractTechproductsTest extends \PHPUnit_Framework_TestCase
];
$this->client = new \Solarium\Client($config);
try {
$ping = $this->client->createPing();
$this->client->ping($ping);
}
catch (\Exception $e) {
$this->markTestSkipped('Solr techproducts example not reachable.');
}
}
/**
......
......@@ -34,7 +34,7 @@ namespace Solarium\Tests\QueryType\MoreLikeThis;
use Solarium\QueryType\MoreLikeThis\Query;
use Solarium\Core\Client\Client;
use Solarium\QueryType\Select\Query\FilterQuery;
use Solarium\QueryType\Select\Query\Component\MoreLikeThis;
use Solarium\Component\MoreLikeThis;
class QueryTest extends \PHPUnit_Framework_TestCase
{
......@@ -551,7 +551,7 @@ class QueryTest extends \PHPUnit_Framework_TestCase
$mlt = $this->query->getMoreLikeThis();
$this->assertEquals(
'Solarium\QueryType\Select\Query\Component\MoreLikeThis',
'Solarium\Component\MoreLikeThis',
get_class($mlt)
);
}
......@@ -620,7 +620,7 @@ class QueryTest extends \PHPUnit_Framework_TestCase
$spellcheck = $this->query->getSpellcheck();
$this->assertEquals(
'Solarium\QueryType\Select\Query\Component\Spellcheck',
'Solarium\Component\Spellcheck',
get_class($spellcheck)
);
}
......@@ -650,7 +650,7 @@ class QueryTest extends \PHPUnit_Framework_TestCase
$stats = $this->query->getDebug();
$this->assertEquals(
'Solarium\QueryType\Select\Query\Component\Debug',
'Solarium\Component\Debug',
get_class($stats)
);
}
......
......@@ -34,7 +34,7 @@ namespace Solarium\Tests\QueryType\Select\Query;
use Solarium\QueryType\Select\Query\Query;
use Solarium\QueryType\Select\Query\FilterQuery;
use Solarium\Core\Client\Client;
use Solarium\QueryType\Select\Query\Component\MoreLikeThis;
use Solarium\Component\MoreLikeThis;
abstract class AbstractQueryTest extends \PHPUnit_Framework_TestCase
{
......@@ -572,7 +572,7 @@ abstract class AbstractQueryTest extends \PHPUnit_Framework_TestCase
$mlt = $this->query->getMoreLikeThis();
$this->assertEquals(
'Solarium\QueryType\Select\Query\Component\MoreLikeThis',
'Solarium\Component\MoreLikeThis',
get_class($mlt)
);
}
......@@ -641,11 +641,21 @@ abstract class AbstractQueryTest extends \PHPUnit_Framework_TestCase
$spellcheck = $this->query->getSpellcheck();
$this->assertEquals(
'Solarium\QueryType\Select\Query\Component\Spellcheck',
'Solarium\Component\Spellcheck',
get_class($spellcheck)
);
}
public function testGetSuggester()
{
$suggester = $this->query->getSuggester();
$this->assertEquals(
'Solarium\Component\Suggester',
get_class($suggester)
);
}
public function testGetDistributedSearch()
{
$spellcheck = $this->query->getDistributedSearch();
......@@ -671,7 +681,7 @@ abstract class AbstractQueryTest extends \PHPUnit_Framework_TestCase
$stats = $this->query->getDebug();
$this->assertEquals(
'Solarium\QueryType\Select\Query\Component\Debug',
'Solarium\Component\Debug',
get_class($stats)
);
}
......@@ -714,7 +724,7 @@ abstract class AbstractQueryTest extends \PHPUnit_Framework_TestCase
$spatial = $this->query->getSpatial();
$this->assertEquals(
'Solarium\QueryType\Select\Query\Component\Spatial',
'Solarium\Component\Spatial',
get_class($spatial)
);
}
......
......@@ -31,7 +31,7 @@
namespace Solarium\Tests\QueryType\Select\Query\Component;
use Solarium\QueryType\Select\Query\Component\Debug;
use Solarium\Component\Debug;
use Solarium\QueryType\Select\Query\Query;
class DebugTest extends \PHPUnit_Framework_TestCase
......@@ -68,7 +68,7 @@ class DebugTest extends \PHPUnit_Framework_TestCase
public function testGetResponseParser()
{
$this->assertInstanceOf(
'Solarium\QueryType\Select\ResponseParser\Component\Debug',
'Solarium\Component\ResponseParser\Debug',
$this->debug->getResponseParser()
);
}
......@@ -76,7 +76,7 @@ class DebugTest extends \PHPUnit_Framework_TestCase
public function testGetRequestBuilder()
{
$this->assertInstanceOf(
'Solarium\QueryType\Select\RequestBuilder\Component\Debug',
'Solarium\Component\RequestBuilder\Debug',
$this->debug->getRequestBuilder()
);
}
......
......@@ -31,7 +31,7 @@
namespace Solarium\Tests\QueryType\Select\Query\Component;
use Solarium\QueryType\Select\Query\Component\MoreLikeThis;
use Solarium\Component\MoreLikeThis;
use Solarium\QueryType\Select\Query\Query;
class MoreLikeThisTest extends \PHPUnit_Framework_TestCase
......@@ -82,7 +82,7 @@ class MoreLikeThisTest extends \PHPUnit_Framework_TestCase
public function testGetResponseParser()
{
$this->assertInstanceOf(
'Solarium\QueryType\Select\ResponseParser\Component\MoreLikeThis',
'Solarium\Component\ResponseParser\MoreLikeThis',
$this->mlt->getResponseParser()
);
}
......@@ -90,7 +90,7 @@ class MoreLikeThisTest extends \PHPUnit_Framework_TestCase
public function testGetRequestBuilder()
{
$this->assertInstanceOf(
'Solarium\QueryType\Select\RequestBuilder\Component\MoreLikeThis',
'Solarium\Component\RequestBuilder\MoreLikeThis',
$this->mlt->getRequestBuilder()
);
}
......
......@@ -2,7 +2,7 @@
namespace Solarium\Tests\QueryType\Select\Query\Component;
use Solarium\QueryType\Select\Query\Component\Spatial;
use Solarium\Component\Spatial;
use Solarium\QueryType\Select\Query\Query;
class SpatialTest extends \PHPUnit_Framework_TestCase
......@@ -48,7 +48,7 @@ class SpatialTest extends \PHPUnit_Framework_TestCase
public function testGetRequestBuilder()
{
$this->assertInstanceOf(
'Solarium\QueryType\Select\RequestBuilder\Component\Spatial',
'Solarium\Component\RequestBuilder\Spatial',
$this->spatial->getRequestBuilder()
);
}
......
......@@ -31,7 +31,7 @@
namespace Solarium\Tests\QueryType\Select\Query\Component;
use Solarium\QueryType\Select\Query\Component\Spellcheck;
use Solarium\Component\Spellcheck;
use Solarium\QueryType\Select\Query\Query;
class SpellcheckTest extends \PHPUnit_Framework_TestCase
......@@ -55,7 +55,7 @@ class SpellcheckTest extends \PHPUnit_Framework_TestCase
public function testGetResponseParser()
{
$this->assertInstanceOf(
'Solarium\QueryType\Select\ResponseParser\Component\Spellcheck',
'Solarium\Component\ResponseParser\Spellcheck',
$this->spellCheck->getResponseParser()
);
}
......@@ -63,7 +63,7 @@ class SpellcheckTest extends \PHPUnit_Framework_TestCase
public function testGetRequestBuilder()
{
$this->assertInstanceOf(
'Solarium\QueryType\Select\RequestBuilder\Component\Spellcheck',
'Solarium\Component\RequestBuilder\Spellcheck',
$this->spellCheck->getRequestBuilder()
);
}
......
......@@ -31,8 +31,8 @@
namespace Solarium\Tests\QueryType\Select\RequestBuilder\Component;
use Solarium\QueryType\Select\RequestBuilder\Component\Debug as RequestBuilder;
use Solarium\QueryType\Select\Query\Component\Debug as Component;
use Solarium\Component\RequestBuilder\Debug as RequestBuilder;
use Solarium\Component\Debug as Component;
use Solarium\Core\Client\Request;
class DebugTest extends \PHPUnit_Framework_TestCase
......
......@@ -31,8 +31,8 @@
namespace Solarium\Tests\QueryType\Select\RequestBuilder\Component;
use Solarium\QueryType\Select\RequestBuilder\Component\MoreLikeThis as RequestBuilder;
use Solarium\QueryType\Select\Query\Component\MoreLikeThis as Component;
use Solarium\Component\RequestBuilder\MoreLikeThis as RequestBuilder;
use Solarium\Component\MoreLikeThis as Component;
use Solarium\Core\Client\Request;
class MoreLikeThisTest extends \PHPUnit_Framework_TestCase
......
......@@ -2,8 +2,8 @@
namespace Solarium\Tests\QueryType\Select\RequestBuilder\Component;
use Solarium\QueryType\Select\RequestBuilder\Component\Spatial as RequestBuilder;
use Solarium\QueryType\Select\Query\Component\Spatial as Component;
use Solarium\Component\RequestBuilder\Spatial as RequestBuilder;
use Solarium\Component\Spatial as Component;
use Solarium\Core\Client\Request;
class SpatialTest extends \PHPUnit_Framework_TestCase
......
......@@ -31,8 +31,8 @@
namespace Solarium\Tests\QueryType\Select\RequestBuilder\Component;
use Solarium\QueryType\Select\RequestBuilder\Component\Spellcheck as RequestBuilder;
use Solarium\QueryType\Select\Query\Component\Spellcheck as Component;
use Solarium\Component\RequestBuilder\Spellcheck as RequestBuilder;
use Solarium\Component\Spellcheck as Component;
use Solarium\Core\Client\Request;
class SpellcheckTest extends \PHPUnit_Framework_TestCase
......
......@@ -35,7 +35,7 @@ use Solarium\Core\Client\Request;
use Solarium\QueryType\Select\Query\Query;
use Solarium\QueryType\Select\Query\FilterQuery;
use Solarium\QueryType\Select\RequestBuilder\RequestBuilder as RequestBuilder;
use Solarium\QueryType\Select\Query\Component\AbstractComponent;
use Solarium\Component\AbstractComponent;
class RequestBuilderTest extends \PHPUnit_Framework_TestCase
{
......
......@@ -31,8 +31,8 @@
namespace Solarium\Tests\QueryType\Select\ResponseParser\Component;
use Solarium\QueryType\Select\ResponseParser\Component\Debug as Parser;
use Solarium\QueryType\Select\Result\Debug\Detail;
use Solarium\Component\ResponseParser\Debug as Parser;
use Solarium\Component\Result\Debug\Detail;
class DebugTest extends \PHPUnit_Framework_TestCase
{
......
......@@ -31,10 +31,10 @@
namespace Solarium\Tests\QueryType\Select\ResponseParser\Component;
use Solarium\QueryType\Select\ResponseParser\Component\MoreLikeThis as Parser;
use Solarium\Component\ResponseParser\MoreLikeThis as Parser;
use Solarium\QueryType\Select\Query\Query;
use Solarium\QueryType\Select\Result\Document;
use Solarium\QueryType\Select\Result\MoreLikeThis\Result;
use Solarium\Component\Result\MoreLikeThis\Result;
class MoreLikeThisTest extends \PHPUnit_Framework_TestCase
{
......
......@@ -31,7 +31,7 @@
namespace Solarium\Tests\QueryType\Select\ResponseParser\Component;
use Solarium\QueryType\Select\ResponseParser\Component\Spellcheck as Parser;
use Solarium\Component\ResponseParser\Spellcheck as Parser;
use Solarium\QueryType\Select\Query\Query;
class SpellcheckTest extends \PHPUnit_Framework_TestCase
......
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