ElasticSearch LBS检索

$data = Http\Request::get('poi/users/_search?', array(
	'query' => array(
		'match_all' => array(),
	),
	'filter' => array(
		'geo_distance' => array(
			'distance' => '10km',#10km以内
			"location" => array('lat' => $lat, 'lon' => $lon),
		),
	),
	'sort' => array(
		array(
			'_geo_distance' => array(
				"location" => array('lat' => $lat, 'lon' => $lon),
				"order" => "asc",#由近到远
				"unit" => 'm',#输出距离单位
				//"distance_type" => "plane",
			),
		),
	),
	'from' => 1,
	'size' => 100,
));
去打赏

您的支持将鼓励我们继续创作!

[微信] 扫描二维码打赏

发表评论

电子邮件地址不会被公开。