Azure-Geosearch-返回距离

问题描述

我正在使用Postman中的Azure搜索API。我有一个查询,我可以在该查询中返回指定半径内的字段,并按从最近的顺序返回它们。

有没有一种方法可以显示实际距离。例如,如果某个地方在5.5公里外,则返回为字段。

这是我的POST请求

https://.search.windows.net/indexes/general-practitioner-practice//docs/search?api-version=2020-06-30&search=&filter=geo.distance(geo_location,geography'POINT(1111,1111)') le 4,&select=*&count=true

这是我的身体

{
  "search": "","filter": "geo.distance(Location,1111)') le 4","select": "*","count": "true"
}

解决方法

Azure认知搜索当前不支持在查询结果中返回距离。解决方法是在客户端进行计算。有关如何执行此操作的详细信息,请参见herehere

如果您希望在Azure认知搜索中添加对此功能的支持,请对this UserVoice item进行投票以帮助我们确定优先级。