solr - 从 LatLonType 升级到 LatLonPointSpatialField

标签 solr geospatial spatial boosting

我正在使用 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/

相关文章:

lucene - 在 Solr 中使用地理位置进行排名

solr - Solr DIH 可以进行原子更新吗?`

elasticsearch - 何时直接查询cassandra与使用索引器

r - 平滑ggplot2 map

math - 如何计算两个坐标之间的距离(没有 float )?

r - spplot图例在 map 中的自定义位置

powershell - Solr 7.3.1 不会启动 "SSL_PORT_PROP"此时是意外的

mysql - 在 Solr 中搜索

MySQL Postgresql/PostGIS

hibernate - Hibernate/spatial 的规范/谓词来过滤实体,无论它是否在半径内