-
Notifications
You must be signed in to change notification settings - Fork 301
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #456 from solariumphp/develop
Creating new release
- Loading branch information
Showing
21 changed files
with
494 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
96 changes: 96 additions & 0 deletions
96
library/Solarium/QueryType/Select/Query/Component/Spatial.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
<?php | ||
|
||
namespace Solarium\QueryType\Select\Query\Component; | ||
|
||
use Solarium\QueryType\Select\Query\Query as SelectQuery; | ||
use Solarium\QueryType\Select\RequestBuilder\Component\Spatial as RequestBuilder; | ||
|
||
/** | ||
* Spatial component. | ||
* | ||
* @link https://cwiki.apache.org/confluence/display/solr/Spatial+Search | ||
*/ | ||
class Spatial extends AbstractComponent | ||
{ | ||
/** | ||
* Get component type. | ||
* | ||
* @return string | ||
*/ | ||
public function getType() | ||
{ | ||
return SelectQuery::COMPONENT_SPATIAL; | ||
} | ||
|
||
/** | ||
* Get a requestbuilder for this query. | ||
* | ||
* @return RequestBuilder | ||
*/ | ||
public function getRequestBuilder() | ||
{ | ||
return new RequestBuilder(); | ||
} | ||
|
||
/** | ||
* This component has no response parser... | ||
*/ | ||
public function getResponseParser() | ||
{ | ||
return; | ||
} | ||
|
||
/** | ||
* @param string $sfield | ||
*/ | ||
public function setField($sfield) | ||
{ | ||
$this->setOption('sfield', $sfield); | ||
} | ||
|
||
/** | ||
* @param int $distance | ||
*/ | ||
public function setDistance($distance) | ||
{ | ||
$this->setOption('d', $distance); | ||
} | ||
|
||
/** | ||
* @param string $point | ||
*/ | ||
public function setPoint($point) | ||
{ | ||
$this->setOption('pt', $point); | ||
} | ||
|
||
/** | ||
* Get sfield option. | ||
* | ||
* @return string|null | ||
*/ | ||
public function getField() | ||
{ | ||
return $this->getOption('sfield'); | ||
} | ||
|
||
/** | ||
* Get d option. | ||
* | ||
* @return int|null | ||
*/ | ||
public function getDistance() | ||
{ | ||
return $this->getOption('d'); | ||
} | ||
|
||
/** | ||
* Get pt option. | ||
* | ||
* @return int|null | ||
*/ | ||
public function getPoint() | ||
{ | ||
return $this->getOption('pt'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
library/Solarium/QueryType/Select/RequestBuilder/Component/Spatial.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
namespace Solarium\QueryType\Select\RequestBuilder\Component; | ||
|
||
use Solarium\QueryType\Select\Query\Component\Spatial as SpatialComponent; | ||
use Solarium\Core\Client\Request; | ||
|
||
/** | ||
* Add select component spatial to the request. | ||
*/ | ||
class Spatial implements ComponentRequestBuilderInterface | ||
{ | ||
/** | ||
* Add request settings for Spatial. | ||
* | ||
* @param SpatialComponent $component | ||
* @param Request $request | ||
* | ||
* @return Request | ||
*/ | ||
public function buildComponent($component, $request) | ||
{ | ||
$request->addParam('sfield', $component->getField()); | ||
$request->addParam('pt', $component->getPoint()); | ||
$request->addParam('d', $component->getDistance()); | ||
|
||
return $request; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.