如何将距离值存储到SortValues或实体

问题描述 投票:0回答:1

如何使用SDE4.0 @Query和SearchHit将距离值存储到SortValues或实体中>

"sort": [
  {
    "_geo_distance" : {
      "codenames.geoLocation" : [
        {
          "lat" : 32.846027,
          "lon" : -96.84987
        }
      ],
      "unit" : "mi",
      "order" : "asc",
    }
  }
]

如何使用SDE4.0 @Query和SearchHit“ sort”将距离值存储到SortValues或实体:[{“ _geo_distance”:{“ codenames.geoLocation”:[{“ lat”:32.846027,...

elasticsearch spring-data elastic-stack spring-data-elasticsearch
1个回答
0
投票

您必须在存储库查询中添加Sort参数,请参阅the documentation for Spring Data Elasticsearch 4在此进行描述。

© www.soinside.com 2019 - 2024. All rights reserved.