2010-03-02 107 views
4

我在尝试使用空间示例搜索位置感知搜索 http://www.ibm.com/developerworks/java/library/j-spatial/#indexing.approaches位置感知搜索

schema.xml有一个geohash字段,但该字段不存在于任何用于索引的.osm文件(存在于数据文件夹中)。我无法理解值是如何分配给它的,所以当我给出这个查询时

http://localhost:8983/solr/select/?q=_val_:"recip (ghhsin(geohash(44.79, -93), geohash, 3963.205), 1, 1, 0)"^100 

结果集有检索到的geohash值。它是如何发生的?请帮帮我。

+1

官方空间搜索将与Solr 1.5一起发布。在此期间您可以使用JTeam的插件:http://www.jteam.nl/news/spatialsolr.html – 2010-03-02 12:31:19

+0

我目前使用Solr 1.5 Nightly build,但链接表示ssp与Solr 1.4兼容。我必须只与solr1.4一起去吗? – kshama 2010-03-02 12:55:33

+0

我不知道。 SSP不像即将到来的空间支持那么灵活,但它现在*现在可以工作*,使用简单,并且有很好的文档记录。 – 2010-03-02 13:57:15

回答

2

Solr wiki有一个相当不错的页面,介绍如何用solr 1.5+完成空间搜索。

总之,你的架构定义了“地理散列”类型的字段:

<fieldtype name="geohash" class="solr.GeoHashField"/> 
<field name="destination" type="geohash" indexed="true" stored="true"/> 

数据馈线传递geohashed坐标:

<field name="destination">cbj1pb56p4b</field> <!-- 45.17614 -93.87341 --> 

你或许应该回到使用简单的纬度和经度坐标从开始。有更好的文档。