我正在使用 Solr 6.5.1
LatLonType 现在已弃用 ( https://lucene.apache.org/solr/guide/6_6/spatial-search.html )
我正在尝试使用 LatLonPointSpatialField。我还需要它具有多重值(value)。
我的字段定义如下:
<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()
函数与分数相乘以改变结果分数。
最佳答案
对我有用的解决方案:
之前(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
关于solr - 从 LatLonType 升级到 LatLonPointSpatialField,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47025453/