Commit 2b84e42f authored by Markus Kalkbrenner's avatar Markus Kalkbrenner Committed by GitHub

Merge pull request #547 from solariumphp/4.x

The "master" branch is now dedicated to solarium 4.x.
A new "3.x" branch was introduced to still maintain solarium 3.x (previously in master) with minimal bugfixes and security updates for some time, especially for people using older PHP or Solr versions.
parents 5f61e63a 6af3dd28
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
</state>
</component>
\ No newline at end of file
......@@ -6,25 +6,30 @@ php:
- 7.1
- 7.0
- 5.6
- 5.5
- 5.4
- 5.3
- hhvm
- nightly
env:
- SYMFONY_VERSION=2.3.*
- SYMFONY_VERSION=2.7.*
- SYMFONY_VERSION=2.8.*
- SYMFONY_VERSION=3.0.* # Does not work with php below 5.5
# - SYMFONY_VERSION=2.3.* SOLR_VERSION=6.6.1
# - SYMFONY_VERSION=2.7.* SOLR_VERSION=6.6.1
- SYMFONY_VERSION=2.8.* SOLR_VERSION=6.6.2
- SYMFONY_VERSION=3.0.* SOLR_VERSION=6.6.2
- SYMFONY_VERSION=4.0.* SOLR_VERSION=6.6.2
- SYMFONY_VERSION=4.0.* SOLR_VERSION=7.2.0
cache:
directories:
- $HOME/.composer/cache
before_install:
- composer global require "hirak/prestissimo:^0.3"
- curl -O http://archive.apache.org/dist/lucene/solr/${SOLR_VERSION}/solr-${SOLR_VERSION}.tgz
- tar -xzf solr-${SOLR_VERSION}.tgz
before_script:
- bash -c "if [ $TRAVIS_PHP_VERSION != 'hhvm' ] && [ $TRAVIS_PHP_VERSION != '7.0' ] && [ $TRAVIS_PHP_VERSION != 'nightly' ]; then printf '\n\n\n\n' | pecl install pecl_http-1.7.6; fi"
# - pecl install pecl_http
- composer require --prefer-source --dev symfony/event-dispatcher:${SYMFONY_VERSION}
- solr-${SOLR_VERSION}/bin/solr start -e techproducts
script: vendor/bin/phpunit -c phpunit.xml.travis -v
......@@ -33,12 +38,19 @@ after_success:
matrix:
exclude:
- php: 5.3
env: SYMFONY_VERSION=3.0.*
- php: 5.4
env: SYMFONY_VERSION=3.0.*
- php: 7.0
env: SYMFONY_VERSION=4.0.* SOLR_VERSION=6.6.2
- php: 7.0
env: SYMFONY_VERSION=4.0.* SOLR_VERSION=7.2.0
- php: 5.6
env: SYMFONY_VERSION=4.0.* SOLR_VERSION=6.6.2
- php: 5.6
env: SYMFONY_VERSION=4.0.* SOLR_VERSION=7.2.0
- php: hhvm
env: SYMFONY_VERSION=4.0.* SOLR_VERSION=6.6.2
- php: hhvm
env: SYMFONY_VERSION=4.0.* SOLR_VERSION=7.2.0
allow_failures:
- php: 5.3
- php: nightly
sudo: false
......@@ -12,14 +12,14 @@
}
],
"require": {
"php": ">=5.3.2",
"symfony/event-dispatcher": "~2.3|~3.0"
"php": ">=5.6",
"symfony/event-dispatcher": "^2.7 || ^3.0 || ^4.0"
},
"require-dev": {
"phpunit/phpunit": "~3.7",
"squizlabs/php_codesniffer": "~1.4",
"zendframework/zendframework1": "~1.12",
"satooshi/php-coveralls": "~1.0",
"phpunit/phpunit": "^3.7",
"squizlabs/php_codesniffer": "^1.4",
"zendframework/zendframework1": "^1.12",
"satooshi/php-coveralls": "^1.0",
"guzzlehttp/guzzle": "^3.8 || ^6.2"
},
"suggest": {
......@@ -27,10 +27,17 @@
},
"extra": {
"branch-alias": {
"dev-develop": "3.3.x-dev"
"dev-develop": "4.0.x-dev"
}
},
"autoload": {
"psr-0": { "Solarium\\": "library/" }
"psr-4": {
"Solarium\\": "library/"
}
},
"autoload-dev": {
"psr-4": {
"Solarium\\Tests\\": "tests/"
}
}
}
<?php
require(__DIR__.'/init.php');
htmlHeader();
// create a client instance
$client = new Solarium\Client($config);
// get a spellcheck query instance
$query = $client->createSpellcheck();
$query->setQuery('cort');
$query->setOnlyMorePopular(true);
$query->setCount(10);
$query->setCollate(true);
// this executes the query and returns the result
$resultset = $client->spellcheck($query);
echo '<b>Query:</b> '.$query->getQuery().'<hr/>';
// display results for each term
foreach ($resultset as $term => $termResult) {
echo '<h3>' . $term . '</h3>';
echo 'NumFound: '.$termResult->getNumFound().'<br/>';
echo 'StartOffset: '.$termResult->getStartOffset().'<br/>';
echo 'EndOffset: '.$termResult->getEndOffset().'<br/>';
echo 'Suggestions:<br/>';
foreach ($termResult as $result) {
echo '- '.$result['word'].'<br/>';
}
echo '<hr/>';
}
// display collation
echo 'Collation: '.$resultset->getCollation();
htmlFooter();
......@@ -8,11 +8,10 @@ $client = new Solarium\Client($config);
// get a suggester query instance
$query = $client->createSuggester();
$query->setQuery('ap ip v'); //multiple terms
$query->setDictionary('suggest');
$query->setOnlyMorePopular(true);
$query->setQuery('c');
$query->setDictionary('mySuggester');
$query->setBuild(true);
$query->setCount(10);
$query->setCollate(true);
// this executes the query and returns the result
$resultset = $client->suggester($query);
......@@ -20,20 +19,17 @@ $resultset = $client->suggester($query);
echo '<b>Query:</b> '.$query->getQuery().'<hr/>';
// display results for each term
foreach ($resultset as $term => $termResult) {
echo '<h3>' . $term . '</h3>';
echo 'NumFound: '.$termResult->getNumFound().'<br/>';
echo 'StartOffset: '.$termResult->getStartOffset().'<br/>';
echo 'EndOffset: '.$termResult->getEndOffset().'<br/>';
echo 'Suggestions:<br/>';
foreach ($termResult as $result) {
echo '- '.$result.'<br/>';
foreach ($resultset as $dictionary => $terms) {
echo '<h3>' . $dictionary . '</h3>';
foreach ($terms as $term => $termResult) {
echo '<h4>' . $term . '</h4>';
echo 'NumFound: '.$termResult->getNumFound().'<br/>';
foreach ($termResult as $result) {
echo '- '.$result['term'].'<br/>';
}
}
echo '<hr/>';
}
// display collation
echo 'Collation: '.$resultset->getCollation();
htmlFooter();
......@@ -23,8 +23,8 @@ class MyClient extends Client
protected $queryTypes = array(
self::QUERY_SELECT => array(
'query' => 'MyQuery',
'requestbuilder' => 'Solarium\QueryType\Select\RequestBuilder\RequestBuilder',
'responseparser' => 'Solarium\QueryType\Select\ResponseParser\ResponseParser'
'requestbuilder' => 'Solarium\QueryType\Select\RequestBuilder',
'responseparser' => 'Solarium\QueryType\Select\ResponseParser'
),
);
}
......
......@@ -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\QueryType\Select\Query\Component;
namespace Solarium\Component;
use Solarium\Core\Configurable;
use Solarium\Core\Query\Helper;
......
<?php
namespace Solarium\Component;
/**
* Trait query types supporting components.
*/
interface ComponentAwareQueryInterface
{
/**
* 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';
/**
* Query component facetset.
*/
const COMPONENT_FACETSET = 'facetset';
/**
* Query component dismax.
*/
const COMPONENT_DISMAX = 'dismax';
/**
* Query component dismax.
*/
const COMPONENT_EDISMAX = 'edismax';
/**
* Query component highlighting.
*/
const COMPONENT_HIGHLIGHTING = 'highlighting';
/**
* Query component grouping.
*/
const COMPONENT_GROUPING = 'grouping';
/**
* Query component distributed search.
*/
const COMPONENT_DISTRIBUTEDSEARCH = 'distributedsearch';
/**
* Query component stats.
*/
const COMPONENT_STATS = 'stats';
/**
* Query component terms.
*/
const COMPONENT_TERMS = 'terms';
/**
* Get all registered component types.
*
* @return array
*/
public function getComponentTypes();
/**
* Register a component type.
*
* @param string $key
* @param string $component
*
* @return self Provides fluent interface
*/
public function registerComponentType($key, $component);
/**
* Get all registered components.
*
* @return AbstractComponent[]
*/
public function getComponents();
/**
* 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 \Solarium\Exception\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);
/**
* 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);
/**
* 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);
}
<?php
namespace Solarium\Component;
use Solarium\Exception\OutOfBoundsException;
/**
* Trait query types supporting components.
*/
trait ComponentAwareQueryTrait
{
/**
* Search components.
*
* @var AbstractComponent[]
*/
protected $components = [];
/**
* Default select query component types.
*
* @var array
*/
protected $componentTypes = [];
/**
* 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];
} elseif ($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 null;
}
/**
* 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);
}
}
}
<?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\QueryType\Select\Query\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;
namespace Solarium\Component\ComponentTraits;
/**
* Spellcheck component.
*
* @link http://wiki.apache.org/solr/SpellCheckComponent
* Spellcheck Component Trait.
*/
class Spellcheck extends AbstractComponent
trait SpellcheckTrait
{
/**
* Used to further customize collation parameters.
......@@ -58,53 +14,6 @@ class Spellcheck extends AbstractComponent
*/
protected $collateParams = array();
/**
* Get component type.
*
* @return string
*/
public function getType()
{
return SelectQuery::COMPONENT_SPELLCHECK;
}
/**
* Get a requestbuilder for this query.
*
* @return RequestBuilder
*/
public function getRequestBuilder()
{
return new RequestBuilder();
}
/**
* Get a response parser for this query.
*
* @return ResponseParser
*/
public function getResponseParser()
{
return new ResponseParser();
}
/**
* Set spellcheck query option.
*
* @param string $query
* @param array $bind Bind values for placeholders in the query string
*
* @return self Provides fluent interface
*/
public function setQuery($query, $bind = null)
{
if (!is_null($bind)) {
$query = $this->getQueryInstance()->getHelper()->assemble($query, $bind);
}
return $this->setOption('query', trim($query));
}
/**
* Get query option.
*
......@@ -413,4 +322,5 @@ class Spellcheck extends AbstractComponent
{
return $this->collateParams;
}
}
<?php
namespace Solarium\Component\ComponentTraits;
/**
* Suggester Query Trait.
*/
trait SuggesterTrait
{
/**
* Get query option.
*
* @return string|null
*/
public function getQuery()
{
return $this->getOption('query');
}
/**
* Set dictionary option.
*
* The name of the dictionary to use
*
* @param string $dictionary
*
* @return self Provides fluent interface
*/
public function setDictionary($dictionary)
{
return $this->setOption('dictionary', $dictionary);
}
/**
* Get dictionary option.
*
* @return string|null
*/
public function getDictionary()
{
return $this->getOption('dictionary');
}
/**
* Set count option.
*
* The maximum number of suggestions to return
*
* @param int $count
*
* @return self Provides fluent interface
*/
public function setCount($count)
{
return $this->setOption('count', $count);
}
/**
* Get count option.
*
* @return int|null
*/
public function getCount()
{
return $this->getOption('count');
}
/**
* Set cfq option.
*
* A Context Filter Query used to filter suggestions based on the context field, if supported by the suggester.
*
* @param string $cfq
*
* @return self Provides fluent interface
*/
public function setContextFilterQuery($cfq)
{
return $this->setOption('cfq', $cfq);
}
/**
* Get cfq option.
*
* @return string|null
*/
public function getContextFilterQuery()
{
return $this->getOption('cfq');
}
/**
* Set build option.
*
* @param boolean $build
*
* @return self Provides fluent interface
*/
public function setBuild($build)
{
return $this->setOption('build', $build);
}
/**
* Get build option.
*
* @return boolean|null
*/
public function getBuild()
{
return $this->getOption('build');
}
/**
* Set reload option.
*
* @param boolean $build
*
* @return self Provides fluent interface
*/
public function setReload($reload)
{
return $this->setOption('reload', $reload);
}
/**
* Get reload option.
*
* @return boolean|null
*/
public function getReload()
{
return $this->getOption('reload');
}
}
<?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\QueryType\Terms;
use Solarium\Core\Client\Client;
use Solarium\Core\Query\AbstractQuery as BaseQuery;
namespace Solarium\Component\ComponentTraits;
/**
* Terms query.
* Terms component.
*
* A terms query provides access to the indexed terms in a field and the number of documents that match each term.
* This can be useful for doing auto-suggest or other things that operate at the term level instead of the search
* or document level. Retrieving terms in index order is very fast since the implementation directly uses Lucene's
* TermEnum to iterate over the term dictionary.
*/
class Query extends BaseQuery
trait TermsTrait
{
/**
* Default options.
*
* @var array
*/
protected $options = array(
'resultclass' => 'Solarium\QueryType\Terms\Result',
'handler' => 'terms',
'omitheader' => true,
);
/**
* Get type for this query.
*
* @return string
*/
public function getType()
{
return Client::QUERY_TERMS;
}
/**
* Get a requestbuilder for this query.
*
* @return RequestBuilder
*/
public function getRequestBuilder()
{
return new RequestBuilder();
}
/**
* Get a response parser for this query.
*
* @return ResponseParser
*/
public function getResponseParser()
{
return new ResponseParser();
}
/**
* Set the field name(s) to get the terms from.
......@@ -405,4 +324,5 @@ class Query extends BaseQuery
{
return $this->getOption('sort');
}
}
......@@ -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 ComponentAwareQueryInterface::COMPONENT_DEBUG;
}
/**
......
<?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\QueryType\Select\Query\Component;
namespace Solarium\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;
use Solarium\Component\RequestBuilder\DisMax as RequestBuilder;
/**
* DisMax 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.
*
* @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\QueryType\Select\Query\Component;
namespace Solarium\Component;
use Solarium\Component\AbstractComponent;
use Solarium\QueryType\Select\Query\Query as SelectQuery;
use Solarium\QueryType\Select\RequestBuilder\Component\DistributedSearch as RequestBuilder;
use Solarium\Component\RequestBuilder\DistributedSearch as RequestBuilder;
/**
* Distributed Search (sharding) component.
......
<?php
/**
* Copyright 2012 Marc Morera. 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 2012 Marc Morera <yuhu@mmoreram.com>
* @license http://github.com/basdenooijer/solarium/raw/master/COPYING
*
* @link http://www.solarium-project.org/
*/
/**
* @namespace
*/
namespace Solarium\QueryType\Select\Query\Component;
namespace Solarium\Component;
use Solarium\QueryType\Select\Query\Query as SelectQuery;
use Solarium\QueryType\Select\RequestBuilder\Component\EdisMax as RequestBuilder;
use Solarium\Component\RequestBuilder\EdisMax as RequestBuilder;
/**
* EdisMax 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.
*
* @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\QueryType\Select\Query\Component\Facet;
namespace Solarium\Component\Facet;
use Solarium\Core\Configurable;
......
<?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\QueryType\Select\Query\Component\Facet;
namespace Solarium\Component\Facet;
use Solarium\QueryType\Select\Query\Component\FacetSet;
use Solarium\Component\FacetSet;
/**
* Facet query.
......
<?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\QueryType\Select\Query\Component\Facet;
namespace Solarium\Component\Facet;
use Solarium\QueryType\Select\Query\Component\FacetSet;
use Solarium\Component\FacetSet;
/**
* Facet interval
......
<?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\QueryType\Select\Query\Component\Facet;
namespace Solarium\Component\Facet;
use Solarium\QueryType\Select\Query\Component\FacetSet;
use Solarium\QueryType\Select\Query\Component\Facet\Query as FacetQuery;
use Solarium\Component\FacetSet;
use Solarium\Component\Facet\Query as FacetQuery;
use Solarium\Exception\InvalidArgumentException;
/**
......
<?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\QueryType\Select\Query\Component\Facet;
namespace Solarium\Component\Facet;
use Solarium\QueryType\Select\Query\Component\FacetSet;
use Solarium\Component\FacetSet;
/**
* Facet pivot.
......
<?php
namespace Solarium\Component\Facet;
use Solarium\Component\FacetSet;
use Solarium\Core\Query\Helper;
/**
* Facet query.
*
* @link http://wiki.apache.org/solr/SimpleFacetParameters#facet.query_:_Arbitrary_Query_Faceting
*/
class Query extends AbstractFacet
{
/**
* Default options.
*
* @var array
*/
protected $options = array(
'query' => '*:*',
);
/**
* Get the facet type.
*
* @return string
*/
public function getType()
{
return FacetSet::FACET_QUERY;
}
/**
* Set the query string.
*
* This overwrites the current value
*
* @param string $query
* @param array $bind Bind values for placeholders in the query string
*
* @return self Provides fluent interface
*/
public function setQuery($query, $bind = null)
{
if (!is_null($bind)) {
$helper = new Helper();
$query = $helper->assemble($query, $bind);
}
return $this->setOption('query', $query);
}
/**
* Get the query string.
*
* @return string
*/
public function getQuery()
{
return $this->getOption('query');
}
}
<?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\QueryType\Select\Query\Component\Facet;
namespace Solarium\Component\Facet;
use Solarium\QueryType\Select\Query\Component\FacetSet;
use Solarium\Component\FacetSet;
/**
* Facet range.
......
<?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\QueryType\Select\Query\Component;
namespace Solarium\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;
use Solarium\Component\RequestBuilder\FacetSet as RequestBuilder;
use Solarium\Component\ResponseParser\FacetSet as ResponseParser;
use Solarium\Exception\InvalidArgumentException;
use Solarium\Exception\OutOfBoundsException;
use Solarium\QueryType\Select\Query\Component\Facet\AbstractFacet;
use Solarium\Component\Facet\AbstractFacet;
/**
* MoreLikeThis component.
......@@ -90,12 +53,12 @@ class FacetSet extends AbstractComponent
* @var array
*/
protected $facetTypes = array(
self::FACET_FIELD => 'Solarium\QueryType\Select\Query\Component\Facet\Field',
self::FACET_QUERY => 'Solarium\QueryType\Select\Query\Component\Facet\Query',
self::FACET_MULTIQUERY => 'Solarium\QueryType\Select\Query\Component\Facet\MultiQuery',
self::FACET_RANGE => 'Solarium\QueryType\Select\Query\Component\Facet\Range',
self::FACET_PIVOT => 'Solarium\QueryType\Select\Query\Component\Facet\Pivot',
self::FACET_INTERVAL => 'Solarium\QueryType\Select\Query\Component\Facet\Interval',
self::FACET_FIELD => 'Solarium\Component\Facet\Field',
self::FACET_QUERY => 'Solarium\Component\Facet\Query',
self::FACET_MULTIQUERY => 'Solarium\Component\Facet\MultiQuery',
self::FACET_RANGE => 'Solarium\Component\Facet\Range',
self::FACET_PIVOT => 'Solarium\Component\Facet\Pivot',
self::FACET_INTERVAL => 'Solarium\Component\Facet\Interval',
);
/**
......@@ -353,7 +316,7 @@ class FacetSet extends AbstractComponent
*
* @throws InvalidArgumentException
*
* @param \Solarium\QueryType\Select\Query\Component\Facet\AbstractFacet|array $facet
* @param \Solarium\Component\Facet\AbstractFacet|array $facet
*
* @return self Provides fluent interface
*/
......@@ -431,7 +394,7 @@ class FacetSet extends AbstractComponent
*
* You can remove a facet by passing its key or the facet instance
*
* @param string|\Solarium\QueryType\Select\Query\Component\Facet\AbstractFacet $facet
* @param string|\Solarium\Component\Facet\AbstractFacet $facet
*
* @return self Provides fluent interface
*/
......@@ -489,7 +452,7 @@ class FacetSet extends AbstractComponent
* @param array|object|null $options
* @param boolean $add
*
* @return \Solarium\QueryType\Select\Query\Component\Facet\AbstractFacet
* @return \Solarium\Component\Facet\AbstractFacet
*/
public function createFacet($type, $options = null, $add = true)
{
......@@ -502,7 +465,7 @@ class FacetSet extends AbstractComponent
$class = $this->facetTypes[$type];
if (is_string($options)) {
/** @var \Solarium\QueryType\Select\Query\Component\Facet\Facet $facet */
/** @var \Solarium\Component\Facet\Facet $facet */
$facet = new $class();
$facet->setKey($options);
} else {
......@@ -522,7 +485,7 @@ class FacetSet extends AbstractComponent
* @param mixed $options
* @param bool $add
*
* @return \Solarium\QueryType\Select\Query\Component\Facet\Field
* @return \Solarium\Component\Facet\Field
*/
public function createFacetField($options = null, $add = true)
{
......@@ -535,7 +498,7 @@ class FacetSet extends AbstractComponent
* @param mixed $options
* @param bool $add
*
* @return \Solarium\QueryType\Select\Query\Component\Facet\Query
* @return \Solarium\Component\Facet\Query
*/
public function createFacetQuery($options = null, $add = true)
{
......@@ -548,7 +511,7 @@ class FacetSet extends AbstractComponent
* @param mixed $options
* @param bool $add
*
* @return \Solarium\QueryType\Select\Query\Component\Facet\MultiQuery
* @return \Solarium\Component\Facet\MultiQuery
*/
public function createFacetMultiQuery($options = null, $add = true)
{
......@@ -561,7 +524,7 @@ class FacetSet extends AbstractComponent
* @param mixed $options
* @param bool $add
*
* @return \Solarium\QueryType\Select\Query\Component\Facet\Range
* @return \Solarium\Component\Facet\Range
*/
public function createFacetRange($options = null, $add = true)
{
......@@ -574,7 +537,7 @@ class FacetSet extends AbstractComponent
* @param mixed $options
* @param bool $add
*
* @return \Solarium\QueryType\Select\Query\Component\Facet\Pivot
* @return \Solarium\Component\Facet\Pivot
*/
public function createFacetPivot($options = null, $add = true)
{
......@@ -605,7 +568,7 @@ class FacetSet extends AbstractComponent
*
* @param mixed $options
* @param bool $add
* @return \Solarium\QueryType\Select\Query\Component\Facet\Interval
* @return \Solarium\Component\Facet\Interval
*/
public function createFacetInterval($options = null, $add = 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/
*/
/**
* @namespace
*/
namespace Solarium\QueryType\Select\Query\Component;
namespace Solarium\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;
use Solarium\Component\RequestBuilder\Grouping as RequestBuilder;
use Solarium\Component\ResponseParser\Grouping as ResponseParser;
/**
* Grouping component.
......@@ -78,8 +41,8 @@ class Grouping extends AbstractComponent
* @var array
*/
protected $options = array(
'resultquerygroupclass' => 'Solarium\QueryType\Select\Result\Grouping\QueryGroup',
'resultvaluegroupclass' => 'Solarium\QueryType\Select\Result\Grouping\ValueGroup',
'resultquerygroupclass' => 'Solarium\Component\Result\Grouping\QueryGroup',
'resultvaluegroupclass' => 'Solarium\Component\Result\Grouping\ValueGroup',
);
/**
......
<?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\QueryType\Select\Query\Component\Highlighting;
namespace Solarium\Component\Highlighting;
use Solarium\Core\Configurable;
......
<?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\QueryType\Select\Query\Component\Highlighting;
namespace Solarium\Component\Highlighting;
use Solarium\QueryType\Select\Query\Query as SelectQuery;
use Solarium\QueryType\Select\Query\Component\AbstractComponent;
use Solarium\QueryType\Select\RequestBuilder\Component\Highlighting as RequestBuilder;
use Solarium\QueryType\Select\ResponseParser\Component\Highlighting as ResponseParser;
use Solarium\Component\AbstractComponent;
use Solarium\Component\RequestBuilder\Highlighting as RequestBuilder;
use Solarium\Component\ResponseParser\Highlighting as ResponseParser;
use Solarium\Exception\InvalidArgumentException;
/**
......
......@@ -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 ComponentAwareQueryInterface::COMPONENT_MORELIKETHIS;
}
/**
......
<?php
namespace Solarium\Component\QueryTraits;
use Solarium\Component\ComponentAwareQueryInterface;
/**
* Trait query types supporting components.
*/
trait DebugTrait
{
/**
* 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(ComponentAwareQueryInterface::COMPONENT_DEBUG, true);
}
}
<?php
namespace Solarium\Component\QueryTraits;
use Solarium\Component\ComponentAwareQueryInterface;
/**
* Trait query types supporting components.
*/
trait DisMaxTrait
{
/**
* Get a DisMax component instance.
*
* This is a convenience method that maps presets to getComponent
*
* @return \Solarium\Component\DisMax
*/
public function getDisMax()
{
return $this->getComponent(ComponentAwareQueryInterface::COMPONENT_DISMAX, true);
}
}
<?php
namespace Solarium\Component\QueryTraits;
use Solarium\Component\ComponentAwareQueryInterface;
/**
* Trait query types supporting components.
*/
trait DistributedSearchTrait
{
/**
* Get a DistributedSearch component instance.
*
* This is a convenience method that maps presets to getComponent
*
* @return \Solarium\Component\DistributedSearch
*/
public function getDistributedSearch()
{
return $this->getComponent(ComponentAwareQueryInterface::COMPONENT_DISTRIBUTEDSEARCH, true);
}
}
<?php
namespace Solarium\Component\QueryTraits;
use Solarium\Component\ComponentAwareQueryInterface;
/**
* Trait query types supporting components.
*/
trait EDisMaxTrait
{
/**
* Get a EdisMax component instance.
*
* This is a convenience method that maps presets to getComponent
*
* @return \Solarium\Component\EdisMax
*/
public function getEDisMax()
{
return $this->getComponent(ComponentAwareQueryInterface::COMPONENT_EDISMAX, true);
}
}
<?php
namespace Solarium\Component\QueryTraits;
use Solarium\Component\ComponentAwareQueryInterface;
/**
* Trait query types supporting components.
*/
trait FacetSetTrait
{
/**
* Get a FacetSet component instance.
*
* This is a convenience method that maps presets to getComponent
*
* @return \Solarium\Component\FacetSet
*/
public function getFacetSet()
{
return $this->getComponent(ComponentAwareQueryInterface::COMPONENT_FACETSET, true);
}
}
<?php
namespace Solarium\Component\QueryTraits;
use Solarium\Component\ComponentAwareQueryInterface;
/**
* Trait query types supporting components.
*/
trait GroupingTrait
{
/**
* Get a grouping component instance.
*
* This is a convenience method that maps presets to getComponent
*
* @return \Solarium\Component\Grouping
*/
public function getGrouping()
{
return $this->getComponent(ComponentAwareQueryInterface::COMPONENT_GROUPING, true);
}
}
<?php
namespace Solarium\Component\QueryTraits;
use Solarium\Component\ComponentAwareQueryInterface;
/**
* Trait query types supporting components.
*/
trait HighlightingTrait
{
/**
* Get a highlighting component instance.
*
* This is a convenience method that maps presets to getComponent
*
* @return \Solarium\Component\Highlighting\Highlighting
*/
public function getHighlighting()
{
return $this->getComponent(ComponentAwareQueryInterface::COMPONENT_HIGHLIGHTING, true);
}
}
<?php
namespace Solarium\Component\QueryTraits;
use Solarium\Component\ComponentAwareQueryInterface;
/**
* Trait query types supporting components.
*/
trait MoreLikeThisTrait
{
/**
* 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(ComponentAwareQueryInterface::COMPONENT_MORELIKETHIS, true);
}
}
<?php
namespace Solarium\Component\QueryTraits;
use Solarium\Component\ComponentAwareQueryInterface;
/**
* Trait query types supporting components.
*/
trait SpatialTrait
{
/**
* 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(ComponentAwareQueryInterface::COMPONENT_SPATIAL, true);
}
}
<?php
namespace Solarium\Component\QueryTraits;
use Solarium\Component\ComponentAwareQueryInterface;
/**
* Trait query types supporting components.
*/
trait SpellcheckTrait
{
/**
* 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(ComponentAwareQueryInterface::COMPONENT_SPELLCHECK, true);
}
}
<?php
namespace Solarium\Component\QueryTraits;
use Solarium\Component\ComponentAwareQueryInterface;
/**
* Trait query types supporting components.
*/
trait StatsTrait
{
/**
* Get a Stats component instance.
*
* This is a convenience method that maps presets to getComponent
*
* @return \Solarium\Component\Stats\Stats
*/
public function getStats()
{
return $this->getComponent(ComponentAwareQueryInterface::COMPONENT_STATS, true);
}
}
<?php
namespace Solarium\Component\QueryTraits;
use Solarium\Component\ComponentAwareQueryInterface;
/**
* Trait query types supporting components.
*/
trait SuggesterTrait
{
/**
* 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(ComponentAwareQueryInterface::COMPONENT_SUGGESTER, true);
}
}
......@@ -38,10 +38,10 @@
* @namespace
*/
namespace Solarium\QueryType\Select\RequestBuilder\Component;
namespace Solarium\Component\RequestBuilder;
use Solarium\QueryType\Select\Query\Component\AbstractComponent;
use Solarium\Core\Client\Request;
use Solarium\Core\ConfigurableInterface;
/**
* ComponentRequestBuilderInterface.
......@@ -51,8 +51,8 @@ interface ComponentRequestBuilderInterface
/**
* Add request settings for the debug component.
*
* @param AbstractComponent $component
* @param Request $request
* @param ConfigurableInterface $component
* @param Request $request
*
* @return 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\DisMax as DismaxComponent;
use Solarium\Component\DisMax as DismaxComponent;
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\DistributedSearch as DistributedSearchComponent;
use Solarium\Component\DistributedSearch as DistributedSearchComponent;
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\EdisMax as EdismaxComponent;
use Solarium\Component\EdisMax as EdismaxComponent;
use Solarium\Core\Client\Request;
/**
......
......@@ -38,17 +38,17 @@
* @namespace
*/
namespace Solarium\QueryType\Select\RequestBuilder\Component;
namespace Solarium\Component\RequestBuilder;
use Solarium\Core\Client\Request;
use Solarium\QueryType\Select\RequestBuilder\RequestBuilder;
use Solarium\QueryType\Select\Query\Component\FacetSet as FacetsetComponent;
use Solarium\QueryType\Select\Query\Component\Facet\Field as FacetField;
use Solarium\QueryType\Select\Query\Component\Facet\MultiQuery as FacetMultiQuery;
use Solarium\QueryType\Select\Query\Component\Facet\Query as FacetQuery;
use Solarium\QueryType\Select\Query\Component\Facet\Range as FacetRange;
use Solarium\QueryType\Select\Query\Component\Facet\Pivot as FacetPivot;
use Solarium\QueryType\Select\Query\Component\Facet\Interval as FacetInterval;
use Solarium\QueryType\Select\RequestBuilder;
use Solarium\Component\FacetSet as FacetsetComponent;
use Solarium\Component\Facet\Field as FacetField;
use Solarium\Component\Facet\MultiQuery as FacetMultiQuery;
use Solarium\Component\Facet\Query as FacetQuery;
use Solarium\Component\Facet\Range as FacetRange;
use Solarium\Component\Facet\Pivot as FacetPivot;
use Solarium\Component\Facet\Interval as FacetInterval;
use Solarium\Exception\UnexpectedValueException;
/**
......
......@@ -38,9 +38,9 @@
* @namespace
*/
namespace Solarium\QueryType\Select\RequestBuilder\Component;
namespace Solarium\Component\RequestBuilder;
use Solarium\QueryType\Select\Query\Component\Grouping as GroupingComponent;
use Solarium\Component\Grouping as GroupingComponent;
use Solarium\Core\Client\Request;
/**
......
......@@ -38,10 +38,10 @@
* @namespace
*/
namespace Solarium\QueryType\Select\RequestBuilder\Component;
namespace Solarium\Component\RequestBuilder;
use Solarium\QueryType\Select\Query\Component\Highlighting\Highlighting as HighlightingComponent;
use Solarium\QueryType\Select\Query\Component\Highlighting\Field as HighlightingField;
use Solarium\Component\Highlighting\Highlighting as HighlightingComponent;
use Solarium\Component\Highlighting\Field as HighlightingField;
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,14 +34,10 @@
* @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\Core\Client\Request;
use Solarium\QueryType\Spellcheck\SpellcheckInterface;
/**
* Add select component Spellcheck to the request.
......@@ -51,7 +47,7 @@ class Spellcheck implements ComponentRequestBuilderInterface
/**
* Add request settings for Spellcheck.
*
* @param SpellcheckComponent $component
* @param SpellcheckInterface $component
* @param Request $request
*
* @return Request
......
......@@ -38,9 +38,9 @@
* @namespace
*/
namespace Solarium\QueryType\Select\RequestBuilder\Component;
namespace Solarium\Component\RequestBuilder;
use Solarium\QueryType\Select\Query\Component\Stats\Stats as StatsComponent;
use Solarium\Component\Stats\Stats as StatsComponent;
use Solarium\Core\Client\Request;
/**
......
<?php
namespace Solarium\Component\RequestBuilder;
use Solarium\Core\Client\Request;
use Solarium\QueryType\Suggester\SuggesterInterface;
/**
* Add select component Spellcheck to the request.
*/
class Suggester implements ComponentRequestBuilderInterface
{
/**
* Add request settings for Spellcheck.
*
* @param SuggesterInterface $component
* @param Request $request
*
* @return Request
*/
public function buildComponent($component, $request)
{
$request->addParam('suggest', 'true');
$request->addParam('suggest.dictionary', $component->getDictionary());
$request->addParam('suggest.q', $component->getQuery());
$request->addParam('suggest.count', $component->getCount());
$request->addParam('suggest.cfq', $component->getContextFilterQuery());
$request->addParam('suggest.build', $component->getBuild());
$request->addParam('suggest.reload', $component->getReload());
return $request;
}
}
<?php
namespace Solarium\Component\RequestBuilder;
use Solarium\Component\TermsInterface;
use Solarium\Core\Client\Request;
/**
* Build a Terms query request.
*/
class Terms implements ComponentRequestBuilderInterface
{
/**
* Add request settings for Spellcheck.
*
* @param TermsInterface $component
* @param Request $request
*
* @return Request
*/
public function buildComponent($component, $request)
{
$request->setHandler($component->getHandler());
$request->addParam('terms', true);
$request->addParam('terms.lower', $component->getLowerbound());
$request->addParam('terms.lower.incl', $component->getLowerboundInclude());
$request->addParam('terms.mincount', $component->getMinCount());
$request->addParam('terms.maxcount', $component->getMaxCount());
$request->addParam('terms.prefix', $component->getPrefix());
$request->addParam('terms.regex', $component->getRegex());
$request->addParam('terms.limit', $component->getLimit());
$request->addParam('terms.upper', $component->getUpperbound());
$request->addParam('terms.upper.incl', $component->getUpperboundInclude());
$request->addParam('terms.raw', $component->getRaw());
$request->addParam('terms.sort', $component->getSort());
foreach ($component->getFields() as $field) {
$request->addParam('terms.fl', trim($field));
}
foreach ($component->getRegexFlags() as $flag) {
$request->addParam('terms.regex.flag', trim($flag));
}
return $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,22 +38,22 @@
* @namespace
*/
namespace Solarium\QueryType\Select\ResponseParser\Component;
namespace Solarium\Component\ResponseParser;
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;
use Solarium\QueryType\Select\Query\Component\Facet\Query as QueryFacetQuery;
use Solarium\QueryType\Select\Query\Component\Facet\MultiQuery as QueryFacetMultiQuery;
use Solarium\QueryType\Select\Query\Component\Facet\Range as QueryFacetRange;
use Solarium\QueryType\Select\Query\Component\Facet\Pivot as QueryFacetPivot;
use Solarium\QueryType\Select\Result\FacetSet as ResultFacetSet;
use Solarium\QueryType\Select\Result\Facet\Field as ResultFacetField;
use Solarium\QueryType\Select\Result\Facet\Query as ResultFacetQuery;
use Solarium\QueryType\Select\Result\Facet\MultiQuery as ResultFacetMultiQuery;
use Solarium\QueryType\Select\Result\Facet\Range as ResultFacetRange;
use Solarium\QueryType\Select\Result\Facet\Pivot\Pivot as ResultFacetPivot;
use Solarium\QueryType\Select\Result\Facet\Interval as ResultFacetInterval;
use Solarium\Component\FacetSet as QueryFacetSet;
use Solarium\Component\Facet\Field as QueryFacetField;
use Solarium\Component\Facet\Query as QueryFacetQuery;
use Solarium\Component\Facet\MultiQuery as QueryFacetMultiQuery;
use Solarium\Component\Facet\Range as QueryFacetRange;
use Solarium\Component\Facet\Pivot as QueryFacetPivot;
use Solarium\Component\Result\FacetSet as ResultFacetSet;
use Solarium\Component\Result\Facet\Field as ResultFacetField;
use Solarium\Component\Result\Facet\Query as ResultFacetQuery;
use Solarium\Component\Result\Facet\MultiQuery as ResultFacetMultiQuery;
use Solarium\Component\Result\Facet\Range as ResultFacetRange;
use Solarium\Component\Result\Facet\Pivot\Pivot as ResultFacetPivot;
use Solarium\Component\Result\Facet\Interval as ResultFacetInterval;
use Solarium\Exception\RuntimeException;
use Solarium\Core\Query\AbstractResponseParser as ResponseParserAbstract;
......@@ -100,7 +100,7 @@ class FacetSet extends ResponseParserAbstract implements ComponentParserInterfac
foreach ($facets as $k => $facet) {
$facetObject = $facetSet->$method($k);
if ($key == 'facet_pivot') {
/* @var \Solarium\QueryType\Select\Query\Component\Facet\Pivot $facetObject */
/* @var \Solarium\Component\Facet\Pivot $facetObject */
$facetObject->setFields($k);
}
}
......@@ -252,7 +252,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 +267,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]);
}
......
......@@ -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\Grouping as GroupingComponent;
use Solarium\QueryType\Select\Result\Grouping\Result;
use Solarium\QueryType\Select\Result\Grouping\FieldGroup;
use Solarium\Component\Grouping as GroupingComponent;
use Solarium\Component\Result\Grouping\Result;
use Solarium\Component\Result\Grouping\FieldGroup;
/**
* Parse select component Grouping 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\Highlighting\Highlighting as HighlightingComponent;
use Solarium\QueryType\Select\Result\Highlighting\Highlighting as HighlightingResult;
use Solarium\QueryType\Select\Result\Highlighting\Result;
use Solarium\Component\Highlighting\Highlighting as HighlightingComponent;
use Solarium\Component\Result\Highlighting\Highlighting as HighlightingResult;
use Solarium\Component\Result\Highlighting\Result;
/**
* Parse select component Highlighting 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,13 @@
* @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\Result;
use Solarium\Component\Result\Spellcheck\Collation;
use Solarium\Component\Result\Spellcheck\Suggestion;
use Solarium\Core\Query\AbstractResponseParser as ResponseParserAbstract;
/**
......@@ -56,7 +55,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
*
......@@ -114,16 +113,16 @@ class Spellcheck extends ResponseParserAbstract implements ComponentParserInterf
$correctlySpelled = $data['spellcheck']['correctlySpelled'];
}
return new SpellcheckResult\Result($suggestions, $collations, $correctlySpelled);
} else {
return;
return new Result($suggestions, $collations, $correctlySpelled);
}
return null;
}
/**
* Parse collation data into a result object.
*
* @param Query $queryObject
* @param AbstractQuery $queryObject
* @param array $values
*
* @return Collation[]
......
......@@ -38,13 +38,13 @@
* @namespace
*/
namespace Solarium\QueryType\Select\ResponseParser\Component;
namespace Solarium\Component\ResponseParser;
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;
use Solarium\QueryType\Select\Result\Stats\Result as ResultStatsResult;
use Solarium\QueryType\Select\Result\Stats\FacetValue as ResultStatsFacetValue;
use Solarium\Component\Stats\Stats as StatsComponent;
use Solarium\Component\Result\Stats\Stats as ResultStats;
use Solarium\Component\Result\Stats\Result as ResultStatsResult;
use Solarium\Component\Result\Stats\FacetValue as ResultStatsFacetValue;
/**
* Parse select component Stats result from the data.
......
<?php
namespace Solarium\Component\ResponseParser;
use Solarium\Core\Query\AbstractQuery;
use Solarium\Component\Suggester as SuggesterComponent;
use Solarium\Component\Result\Suggester\Result;
use Solarium\Core\Query\AbstractResponseParser;
use Solarium\QueryType\Suggester\Result\Dictionary;
use Solarium\QueryType\Suggester\Result\Term;
/**
* Parse select component Highlighting result from the data.
*/
class Suggester extends AbstractResponseParser implements ComponentParserInterface
{
/**
* Parse result data into result objects.
*
* @param AbstractQuery $query
* @param SuggesterComponent $suggester
* @param array $data
*
* @return Result|null
*/
public function parse($query, $suggester, $data)
{
$dictionaries = [];
$allSuggestions = [];
if (isset($data['suggest']) && is_array($data['suggest'])) {
foreach ($data['suggest'] as $dictionary => $dictionaryResults) {
$terms = [];
foreach ($dictionaryResults as $term => $termData) {
$allSuggestions[] = $this->createTerm($termData);
$terms[$term] = $this->createTerm($termData);
}
$dictionaries[$dictionary] = $this->createDictionary($terms);
}
return new Result($dictionaries, $allSuggestions);
}
return null;
}
private function createDictionary(array $terms)
{
return new Dictionary(
$terms
);
}
private function createTerm(array $termData)
{
return new Term(
$termData['numFound'],
$termData['suggestions']
);
}
}
<?php
namespace Solarium\Component\ResponseParser;
use Solarium\Component\Result\Terms\Field;
use Solarium\Component\Result\Terms\Result;
use Solarium\Component\Result\Terms\Terms as ResultTerms;
use Solarium\Component\Terms as TermsComponent;
use Solarium\Core\Query\AbstractQuery;
use Solarium\Core\Query\AbstractResponseParser;
/**
* Parse Terms response data.
*/
class Terms extends AbstractResponseParser implements ComponentParserInterface
{
/**
* Parse result data into result objects.
*
* @param AbstractQuery $query
* @param TermsComponent $terms
* @param array $data
*
* @return Result|null
*/
public function parse($query, $terms, $data)
{
$allTerms = [];
if (isset($data['terms']) && is_array($data['terms'])) {
$terms = [];
foreach ($data['terms'] as $field => $termData) {
$allTerms[] = $this->createTerms($termData);
$terms[$field] = $this->createTerms($termData);
}
return new Result($this->createField($terms), $allTerms);
}
return null;
}
private function createField(array $terms)
{
return new Field(
$terms
);
}
private function createTerms(array $termData)
{
return new ResultTerms(
$termData
);
}
}
......@@ -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\Facet;
namespace Solarium\Component\Result\Facet;
/**
* Select field facet result.
......
......@@ -36,7 +36,7 @@
/**
* @namespace
*/
namespace Solarium\QueryType\Select\Result\Facet;
namespace Solarium\Component\Result\Facet;
/**
* Select interval facet result
......
......@@ -38,7 +38,7 @@
* @namespace
*/
namespace Solarium\QueryType\Select\Result\Facet;
namespace Solarium\Component\Result\Facet;
/**
* Select multiquery facet result.
......
......@@ -38,7 +38,7 @@
* @namespace
*/
namespace Solarium\QueryType\Select\Result\Facet\Pivot;
namespace Solarium\Component\Result\Facet\Pivot;
/**
* Select field pivot result.
......
......@@ -38,9 +38,9 @@
* @namespace
*/
namespace Solarium\QueryType\Select\Result\Facet\Pivot;
namespace Solarium\Component\Result\Facet\Pivot;
use Solarium\QueryType\Select\Result\Stats\Stats;
use Solarium\Component\Result\Stats\Stats;
/**
* Select field pivot result.
......@@ -82,6 +82,8 @@ class PivotItem extends Pivot
*/
public function __construct($data)
{
parent::__construct([]);
$this->field = $data['field'];
$this->value = $data['value'];
$this->count = $data['count'];
......@@ -129,7 +131,7 @@ class PivotItem extends Pivot
/**
* Get stats
*
*
* @return Stats
*/
public function getStats()
......
......@@ -38,7 +38,7 @@
* @namespace
*/
namespace Solarium\QueryType\Select\Result\Facet;
namespace Solarium\Component\Result\Facet;
/**
* Select query facet result.
......
......@@ -38,7 +38,7 @@
* @namespace
*/
namespace Solarium\QueryType\Select\Result\Facet;
namespace Solarium\Component\Result\Facet;
/**
* Select range facet result.
......@@ -107,7 +107,7 @@ class Range extends Field
*/
public function __construct($values, $before, $after, $between, $start, $end, $gap)
{
$this->values = $values;
parent::__construct($values);
$this->before = $before;
$this->after = $after;
$this->between = $between;
......
......@@ -38,7 +38,7 @@
* @namespace
*/
namespace Solarium\QueryType\Select\Result;
namespace Solarium\Component\Result;
/**
* Select component facetset result.
......
......@@ -38,7 +38,7 @@
* @namespace
*/
namespace Solarium\QueryType\Select\Result\Grouping;
namespace Solarium\Component\Result\Grouping;
/**
* Select component grouping field group result.
......
......@@ -38,7 +38,7 @@
* @namespace
*/
namespace Solarium\QueryType\Select\Result\Grouping;
namespace Solarium\Component\Result\Grouping;
use Solarium\QueryType\Select\Query\Query;
......
......@@ -38,7 +38,7 @@
* @namespace
*/
namespace Solarium\QueryType\Select\Result\Grouping;
namespace Solarium\Component\Result\Grouping;
/**
* Select component grouping result.
......
......@@ -38,7 +38,7 @@
* @namespace
*/
namespace Solarium\QueryType\Select\Result\Grouping;
namespace Solarium\Component\Result\Grouping;
use Solarium\QueryType\Select\Query\Query;
......
......@@ -38,7 +38,7 @@
* @namespace
*/
namespace Solarium\QueryType\Select\Result\Highlighting;
namespace Solarium\Component\Result\Highlighting;
/**
* Select component highlighting result.
......
......@@ -38,7 +38,7 @@
* @namespace
*/
namespace Solarium\QueryType\Select\Result\Highlighting;
namespace Solarium\Component\Result\Highlighting;
/**
* Select component highlighting result item.
......
......@@ -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.
......
......@@ -38,7 +38,7 @@
* @namespace
*/
namespace Solarium\QueryType\Select\Result\Stats;
namespace Solarium\Component\Result\Stats;
/**
* Select component stats facet value.
......
......@@ -38,7 +38,7 @@
* @namespace
*/
namespace Solarium\QueryType\Select\Result\Stats;
namespace Solarium\Component\Result\Stats;
/**
* Select component stats field result item.
......
......@@ -38,7 +38,7 @@
* @namespace
*/
namespace Solarium\QueryType\Select\Result\Stats;
namespace Solarium\Component\Result\Stats;
/**
* Select component stats result.
......
<?php
namespace Solarium\Component\Result\Suggester;
use Solarium\QueryType\Suggester\Result\Dictionary;
/**
* Component suggester result.
*/
class Result implements \IteratorAggregate, \Countable
{
/**
* Suggester results.
*
* @var array
*/
protected $results;
/**
* Suggester flat results.
*
* @var array
*/
protected $all;
/**
* Constructor.
*
* @param array $results
* @param array $all
*/
public function __construct($results, $all)
{
$this->results = $results;
$this->all = $all;
}
/**
* Get all results.
*
* @return array
*/
public function getResults()
{
return $this->results;
}
/**
* Get flat results.
*
* @return array
*/
public function getAll()
{
return $this->all;
}
/**
* Get results for a specific dictionary.
*
* @param string $dictionary
*
* @return Dictionary|null
*/
public function getDictionary($dictionary)
{
if (isset($this->results[$dictionary])) {
return $this->results[$dictionary];
} else {
return null;
}
}
/**
* IteratorAggregate implementation.
*
* @return \ArrayIterator
*/
public function getIterator()
{
return new \ArrayIterator($this->results);
}
/**
* Countable implementation.
*
* @return int
*/
public function count()
{
return count($this->results);
}
}
<?php
namespace Solarium\Component\Result\Terms;
/**
* Terms component result.
*/
class Field implements \IteratorAggregate, \Countable
{
/**
* Terms.
*
* @var Terms[]
*/
protected $terms;
/**
* Constructor.
*
* @param Terms[] $terms
*/
public function __construct(array $terms)
{
$this->terms = $terms;
}
/**
* Get Terms.
*
* @return Terms[]
*/
public function getAllTerms()
{
return $this->terms;
}
/**
* Get results for a specific term.
*
* @param string $term
*
* @return Terms|null
*/
public function getTerms($field)
{
if (isset($this->terms[$field])) {
return $this->terms[$field];
} else {
return null;
}
}
/**
* IteratorAggregate implementation.
*
* @return \ArrayIterator
*/
public function getIterator()
{
return new \ArrayIterator($this->terms);
}
/**
* Countable implementation.
*
* @return int
*/
public function count()
{
return count($this->terms);
}
}
<?php
namespace Solarium\Component\Result\Terms;
/**
* Component terms result.
*/
class Result implements \IteratorAggregate, \Countable
{
/**
* Terms results.
*
* @var array
*/
protected $results;
/**
* Terms flat results.
*
* @var array
*/
protected $all;
/**
* Constructor.
*
* @param array $results
* @param array $all
*/
public function __construct($results, $all)
{
$this->results = $results;
$this->all = $all;
}
/**
* Get all results.
*
* @return array
*/
public function getResults()
{
return $this->results;
}
/**
* Get flat results.
*
* @return array
*/
public function getAll()
{
return $this->all;
}
/**
* Get results for a specific dictionary.
*
* @param string $field
*
* @return Field|null
*/
public function getField($field)
{
if (isset($this->results[$field])) {
return $this->results[$field];
} else {
return null;
}
}
/**
* IteratorAggregate implementation.
*
* @return \ArrayIterator
*/
public function getIterator()
{
return new \ArrayIterator($this->results);
}
/**
* Countable implementation.
*
* @return int
*/
public function count()
{
return count($this->results);
}
}
<?php
namespace Solarium\Component\Result\Terms;
/**
* Terms.
*/
class Terms implements \IteratorAggregate, \Countable
{
/**
* Terms.
*
* @var array
*/
protected $terms;
/**
* Constructor.
*
* @param array $terms
*/
public function __construct($terms)
{
$this->terms = $terms;
}
/**
* Get suggestions.
*
* @return array
*/
public function getTerms()
{
return $this->terms;
}
/**
* IteratorAggregate implementation.
*
* @return \ArrayIterator
*/
public function getIterator()
{
return new \ArrayIterator($this->terms);
}
/**
* Countable implementation.
*
* @return int
*/
public function count()
{
return count($this->terms);
}
}
<?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 ComponentAwareQueryInterface::COMPONENT_SPATIAL;
}
/**
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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