summaryrefslogtreecommitdiff
path: root/vendor/ruflin/elastica/lib/Elastica/Facet/GeoDistance.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/ruflin/elastica/lib/Elastica/Facet/GeoDistance.php')
-rw-r--r--vendor/ruflin/elastica/lib/Elastica/Facet/GeoDistance.php33
1 files changed, 18 insertions, 15 deletions
diff --git a/vendor/ruflin/elastica/lib/Elastica/Facet/GeoDistance.php b/vendor/ruflin/elastica/lib/Elastica/Facet/GeoDistance.php
index 35537986..664d33a6 100644
--- a/vendor/ruflin/elastica/lib/Elastica/Facet/GeoDistance.php
+++ b/vendor/ruflin/elastica/lib/Elastica/Facet/GeoDistance.php
@@ -1,14 +1,13 @@
<?php
-
namespace Elastica\Facet;
/**
* Implements the Geo Distance facet.
*
- * @category Xodoa
- * @package Elastica
* @author Gerard A. Matthew <gerard.matthew@gmail.com>
- * @link http://www.elasticsearch.org/guide/reference/api/search/facets/geo-distance-facet.html
+ *
+ * @link http://www.elastic.co/guide/en/elasticsearch/reference/current/search-facets-geo-distance-facet.html
+ * @deprecated Facets are deprecated and will be removed in a future release. You are encouraged to migrate to aggregations instead.
*/
class GeoDistance extends AbstractFacet
{
@@ -20,10 +19,11 @@ class GeoDistance extends AbstractFacet
* array('from' => 20, 'to' => 70),
* array('from' => 70, 'to' => 120),
* array('from' => 150)
- * )
+ * ).
+ *
+ * @param array $ranges Numerical array with range definitions.
*
- * @param array $ranges Numerical array with range definitions.
- * @return \Elastica\Facet\GeoDistance
+ * @return $this
*/
public function setRanges(array $ranges)
{
@@ -33,16 +33,17 @@ class GeoDistance extends AbstractFacet
/**
* Set the relative GeoPoint for the facet.
*
- * @param string $typeField index type and field e.g foo.bar
- * @param float $latitude
- * @param float $longitude
- * @return \Elastica\Facet\GeoDistance
+ * @param string $typeField index type and field e.g foo.bar
+ * @param float $latitude
+ * @param float $longitude
+ *
+ * @return $this
*/
public function setGeoPoint($typeField, $latitude, $longitude)
{
return $this->setParam($typeField, array(
- "lat" => $latitude,
- "lon" => $longitude,
+ 'lat' => $latitude,
+ 'lon' => $longitude,
));
}
@@ -51,15 +52,17 @@ class GeoDistance extends AbstractFacet
* facet definition of the parent.
*
* @see \Elastica\Facet\AbstractFacet::toArray()
+ *
* @throws \Elastica\Exception\InvalidException When the right fields haven't been set.
+ *
* @return array
*/
public function toArray()
{
- /**
+ /*
* Set the geo_distance in the abstract as param.
*/
- $this->_setFacetParam ('geo_distance', $this->_params);
+ $this->_setFacetParam('geo_distance', $this->_params);
return parent::toArray();
}