1

我有一个开始 lat long 和一个结束 lat long,我必须使用 solr spatialSearch 搜索这些点之间的其他记录。如果有人可以帮助我,请提前感谢。

最佳纪录...

艾莎·扎法尔

4

2 回答 2

2

You can use Solr's Bounding-box filter to find the records between the box but it works with single point (lat,lon) and a distance.

If you have two points then you can find the record between this box by using range query. Query could be something like :

..&fq=latField:[lat1 TO lat2] AND lonField:[lon1 TO lon2]

于 2012-12-27T13:39:06.453 回答
0

这是 solr 查询:只需将 pt 更改为搜索坐标,将距离 d 更改为圆的半径。fq={!geofilt sfield=坐标}&pt=10.737845823323038,106.65631819042972&d=2.8'

使用此 schema.xml 配置从 solr 索引的每个文档:

< field name="coordinates" type="geohash" indexed="true" stored="true" multiValued="true" />

并且文档对象应该包含这样的字段: $fields['coordinates'] = implode(',', $post->getCoordinates()->getLatLng());

于 2013-02-18T08:51:55.287 回答