field . '_' . $this->lat . '.' . $this->lon . '_' . $this->distance; } /** * @return array> */ public function toArray(): array { $body = [ 'distance' => $this->distance, $this->field => [ 'lat' => $this->lat, 'lon' => $this->lon, ], 'boost' => $this->boost, ]; if ($this->distanceType !== null) { $body['distance_type'] = $this->distanceType; } if ($this->validationMethod !== null) { $body['validation_method'] = $this->validationMethod; } if ($this->ignoreUnmapped !== null) { $body['ignore_unmapped'] = $this->ignoreUnmapped; } return [ 'geo_distance' => $body, ]; } }