【问题标题】:What should be default value for SortExpression Google App Engine search for 'distance()'?SortExpression Google App Engine 搜索“distance()”的默认值应该是什么?
【发布时间】:2014-04-29 04:49:20
【问题描述】:

我有这样的 SortExpression:

from google.appengine.api.search import search

search.SortExpression(expression = 'distance(geoLocation, geopoint(%s, %s))' 
                      % (geoLatitude, geoLongitude),
                      direction = search.SortExpression.ASCENDING,
                      default_value = sys.float_info.max)

default_value 对应的 distance() 应该是什么?

目前sys.float_info.max 适用于 SDK,但在生产时会产生错误:

InvalidRequest: Failed to parse search request "tag:"zamówienia internetowe" AND tag:"zamówienia na teraz""; Default text value is not appropriate for sort expression 'distance(geoLocation, geopoint(52.1967225, 20.8892005))'

【问题讨论】:

    标签: google-app-engine gae-search


    【解决方案1】:

    如果您希望默认值在结果中排​​在最后,我建议选择一个大于地球最宽点(即赤道)周长一半的值。我相信任何大于 20,038,000 米的值都应该大于任何可能的距离,即使考虑到我们在生产中对地球建模的未来改进。

    克里斯

    【讨论】:

    • 问题与波兰语的典型 unicode 字母 = 英文字母 + ąćęłóńśżźż - qx 有关。我很想念这不是距离问题,因为 unicode 在 SDK 上工作。
    猜你喜欢
    • 2012-01-23
    • 1970-01-01
    • 1970-01-01
    • 2014-07-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-07-03
    相关资源
    最近更新 更多