Re: any docs on using the GeoHashField?

2011-09-14 Thread Peter Wolanin
When I retrieve the value the lat/lon pair that comes out is not
exactly the same as what I indexed, which made be think it was
actually stored as the hash and then transformed back?

Anyhow - I'm trying to understand the actual use case for the field as
it exists - essentially you are saying I could query with a geohash
and use data in this field type to do a distance-based filter from the
lat,lon point corresponding to the geohash?

-Peter

On Thu, Sep 8, 2011 at 5:34 PM, Chris Hostetter
hossman_luc...@fucit.org wrote:

 : I would think I could index a lat,lon pair into a GeoHashField (that
 : works) and then retrieve the field value to see the computed geohash.
        ...
 : What am I missing - how can I retrieve the hash?

 I don't think it's designed to work that way.

 GeoHashField provides GeoHash based search support for lat/lon values
 through it's internal (indexed) representaiton -- much like TrieLongField
 provides efficient range queries using trie encoding -- but the stored
 value is still the lat/lon pair (just as a TrieLongField is still the long
 value)

 If you want to store/retrive a raq GeoHash string, i think you have to
 compute it yourself (or put the logic in an UpdateProcessor).

 org.apache.lucene.spatial.geohash.GeoHashUtils should take care of all the
 heavy lifting for you.

 -Hoss




-- 
Peter M. Wolanin, Ph.D.      : Momentum Specialist,  Acquia. Inc.
peter.wola...@acquia.com : 781-313-8322

Get a free, hosted Drupal 7 site: http://www.drupalgardens.com;


Re: any docs on using the GeoHashField?

2011-09-08 Thread Chris Hostetter

: I would think I could index a lat,lon pair into a GeoHashField (that
: works) and then retrieve the field value to see the computed geohash.
...
: What am I missing - how can I retrieve the hash?

I don't think it's designed to work that way. 

GeoHashField provides GeoHash based search support for lat/lon values 
through it's internal (indexed) representaiton -- much like TrieLongField 
provides efficient range queries using trie encoding -- but the stored 
value is still the lat/lon pair (just as a TrieLongField is still the long 
value)

If you want to store/retrive a raq GeoHash string, i think you have to 
compute it yourself (or put the logic in an UpdateProcessor).  

org.apache.lucene.spatial.geohash.GeoHashUtils should take care of all the 
heavy lifting for you.

-Hoss


any docs on using the GeoHashField?

2011-09-02 Thread Peter Wolanin
looking at http://wiki.apache.org/solr/SpatialSearchDev

I would think I could index a lat,lon pair into a GeoHashField (that
works) and then retrieve the field value to see the computed geohash.

however, that doesn't seem to work.  If I index:  21.4,33.5

The retrieved value is not a hash, but approximately the same lat,lon:
str name=geos_test21.4001527369,33.498472631/str

If I try to filter on a geohash, fq=geos_test:sezcd*  that works, so
I guess the hash is stored internally.

What am I missing - how can I retrieve the hash?

-Peter

-- 
Peter M. Wolanin, Ph.D.      : Momentum Specialist,  Acquia. Inc.
peter.wola...@acquia.com : 781-313-8322

Get a free, hosted Drupal 7 site: http://www.drupalgardens.com;