Indexing GeoHash
Closed this issue · 3 comments
Hi,
After reading the README.txt file, and the Solr wiki, I am not clear on how the geohash can be indexed. Here is what I have in my schema.xml file:
Then I have:
When I am indexing geographic regions, I am indexing the geohash of every coordinates of the region. However, I am not sure if I have to compute geohash before (has I was in Solr 1.4), or if I have to do this like this (from the SpatialSearchDev Solr wiki page):
12.34,-123.45
Right now, with the first method, I am getting this error:
SEVERE: org.apache.solr.common.SolrException: ERROR: [doc=48515f8a1b11e98268655844ad3b4db3] Error adding field 'geohash'='[cbfguvf792c3st63grk3n, ...
Thanks!
GitHub stripped your XML definitions but it came through in the notification email to me. Your fieldType & field definitions look fine. I will assume you removed or commented out the older field type registered at the name "geohash". The use of geohashes is completely internal, you simply pass in "latitude,longitude" formatted data as you just showed which looks good. Perhaps you modified your schema.xml without restarting Solr?
Hi!
"you simply pass in "latitude,longitude" formatted data as you just showed which looks good"
Ok, so this is automagically done then. It was not clear from the documentation. What I did with my test above was to pre-compute the geohash, and to use that as the value of the field (and so, the error). In that case, I will change my importation endpoint to take that into consideration, will retest and re-comment here if I still have issues with indexation.
Will keep you updated, thanks!
Hi David!
Great work! Everything is working properly with Solr 3.6. The indexation happen smoothly, and then my modified query that now uses the modified geodist() function on my geohash field works properly. I am able to modify the boost to sort them around given lat/long (basically, the center of a map). I will continue my investigation, but so far so good!
Take care,
Fred