Solr Distance(geodist())需要以数组/整数形式返回

时间:2019-05-07 09:56:41

标签: solr solrnet

我在solr中有多个地理坐标点作为数组。我需要计算每个点之间的距离和返回距离作为数组。

我在下面的选择查询中尝试过,但是它只返回一个距离。

https://test.com/solr/indextest/select?fl=_group,locations_address_geocoordinate_sm,_dist_:geodist()&pt=29.694776,-95.523277&q=*:*&sfield=locations_address_geocoordinate_sm&wt=json

结果:

{
  "responseHeader":{
    "status":0,
    "QTime":0,
    "params":{
      "q":"*:*",
      "pt":"29.694776,-95.523277",
      "indent":"on",
      "fl":"_group,locations_address_geocoordinate_sm,_dist_:geodist()",
      "sfield":"locations_address_geocoordinate_sm",
      "wt":"json"}},
  "response":{"numFound":1,"start":0,"docs":[
      {
        "_group":"1113d878f9904292b83663d145272004",
        "locations_address_geocoordinate_sm":["29.7743542,-95.3910921",
          "29.7072873,-95.4606412"],
        "_dist_":6.207666562911588}]
  }}

我需要将此属性作为_dist_:{6.1,6.2,6.3}

之类的数组

任何人都可以帮忙吗?

0 个答案:

没有答案