src/Query/Query.php
/**
   * Filters the results to a given radius from lon and lat.
   * Radius is given as a number and units.
   * For more details, visit: https://redis.io/commands/georadius?_ga=2.96317980.1854485156.1601882802-570936883.1598442031
   *
   * @param string $fieldName
   * @param int $longitude
   * @param int $latitude
   * @param int $radius
   * @param string $distanceUnit
   *
   * @return $this
   */
Filters the results to a given radius from lon and lat.
Radius is given as a number and units.



@return $this
Filters the results to a given radius from lon and lat . Radius is given as a number and units . @return $this
public function geoFilter( string $fieldName, int $longitude, int $latitude, int $radius, string $distanceUnit = 'km' ) {
    $geo_units = array( 'm', 'km', 'mi', 'ft' );
    if ( !in_array($distanceUnit, $geo_units) ) {
      throw new InvalidArgumentException($distanceUnit);
    }
    $this->geoFilters[] = "@$fieldName:[$longitude $latitude $radius $distanceUnit]";
    return $this;
  }
public function geoFilter ( string $ fieldName , int $ longitude , int $ latitude , int $ radius , string $ distanceUnit = 'km' ) { $ geo_units = array ( 'm' , 'km' , 'mi' , 'ft' ) ; if ( ! in_array ( $ distanceUnit , $ geo_units ) ) { throw new InvalidArgumentException ( $ distanceUnit ) ; } $ this -> geoFilters [ ] = " @ $ fieldName :[ $ longitude $ latitude $ radius $ distanceUnit ] " ; return $ this ; }
Filters the results to a given radius from lon and lat.
Filters the results to a given radius from lon and lat .