Ejemplo n.º 1
0
 /**
  * @param string       $key       The field on which to filter
  * @param array|string $location  Location as coordinates array or geohash string ['lat' => 40.3, 'lon' => 45.2]
  * @param string|int   $precision Integer length of geohash prefix or distance (3, or "50m")
  * @param bool         $neighbors If true, filters cells next to the given cell.
  */
 public function __construct($key, $location, $precision = -1, $neighbors = false)
 {
     parent::__construct($key, $location);
     $this->setPrecision($precision);
     $this->setNeighbors($neighbors);
 }
Ejemplo n.º 2
0
 /**
  * Create GeoDistance object.
  *
  * @param string       $key      Key
  * @param array|string $location Location as array or geohash: array('lat' => 48.86, 'lon' => 2.35) OR 'drm3btev3e86'
  * @param string       $distance Distance
  *
  * @throws \Elastica\Exception\InvalidException
  */
 public function __construct($key, $location, $distance)
 {
     parent::__construct($key, $location);
     $this->setDistance($distance);
 }