从 LatLonType 升级到 LatLonPointSpatialField

Val*_*yev 5 solr spatial geospatial boosting

我正在使用 Solr 6.5.1

LatLonType 现在已弃用 ( https://lucene.apache.org/solr/guide/6_6/spatial-search.html ),我正在尝试使用 LatLonPointSpatialField。我还需要它具有多重价值。

我的字段定义如下:

<fieldType name="location" class="solr.LatLonPointSpatialField" docValues="true"/>

之前我曾经在我的 LatLonType 字段上提升:

boost=recip(geodist(sfield,45.15,-93.12),3 ,10000,3000) (我正在使用 eDisMax)。

更改空间数据类型后,出现此错误:

A ValueSource isn't directly available from this field. Instead try a query using the distance as the score. 我不明白。

该文档没有说明将geodist函数与 edismax 一起使用以在boost=参数中使用它。相反,它只是建议使用函数值进行排序:https : //lucene.apache.org/solr/guide/6_6/spatial-search.html#SpatialSearch-geodist

但是这对我不起作用,我不需要按距离排序,我希望geodist()函数与分数相乘以改变结果分数。

Val*_*yev 1

对我有用的解决方案:

之前(LatLonType):

boost=recip(geodist(coordinates_ll,49.175,-123.003),1,10,1)

之后(LatLonPointSpatialField):

boost=recip(geodist(),1,10,1)&pt=49.175,-123.003&sfield=coordinates_ll