kshama
kshama

Reputation: 1627

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.

Upvotes: 4

Views: 383

Answers (1)

Nick Gerakines
Nick Gerakines

Reputation: 1450

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.

Upvotes: 2

Related Questions