【问题标题】:Return Value from geo.distance function in a select query选择查询中 geo.distance 函数的返回值
【发布时间】:2018-07-30 08:54:10
【问题描述】:

我正在玩弄查询索引的选择。我想返回索引中的 GeographyPoint 的距离。我正在尝试这样的事情: 其中 GeoPoint 是位置字段

$select=ID,geo.distance(GeoPoint, geography'POINT(-122.131577 47.678581)')

如果你有经纬度和位置,有没有办法在 Select 语句中返回距离?

谢谢!

【问题讨论】:

    标签: azure-cognitive-search


    【解决方案1】:

    Azure 搜索当前不支持在搜索响应中返回 geo.distance 的结果。请为功能投票on User Voice 以帮助我们确定优先级。

    作为一种解决方法,您可以自己计算距离。 This forum threadthis answer 描述了一些方法来做到这一点。

    【讨论】:

      【解决方案2】:

      即使我希望它会工作

      但是您不能通过使用“选择”直接获取距离。它目前仅作为过滤器和 orderby 属性启用。

      'SELECT' 只能用于字段名称

      【讨论】:

        猜你喜欢
        • 2014-08-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-07-02
        • 1970-01-01
        • 1970-01-01
        • 2019-08-09
        • 1970-01-01
        相关资源
        最近更新 更多