开发者

Location aware search

I am trying location aware search with spatial example found in http://www.ibm.com/developerworks/java/library/j-spatial/#indexing开发者_如何转开发.approaches.

The schema.xml has a geohash field, but this field is not present in any of the .osm files (present in data folder) used to index. I am not able to understand how the value is assigned to it, so that when I give this query

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

result set has geohash value retrieved. How is it happening? Please help me.


The Solr wiki has a pretty good page on how Spatial search can be done with solr 1.5+.

To summarize, your schema defines 'geohash' typed fields:

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

Data feeders pass in geohashed coordinates:

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

You probably should go back to using simple latitude and longitude coordinates to start off with. There are better docs for it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜