lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Smiley, David W." <>
Subject custom ValueSource for decoding geohash into lat & lon
Date Thu, 10 Mar 2011 21:16:39 GMT
I'm looking for validation of my approach to geospatial sorting from committers.

I'm starting work on implementing sorting for my geohash based filter code in
 The existing GeohashHaversineFunction uses ValueSources based on the the natural string value
in the index, StrFieldSource, and it decodes them each pass through.  This is obviously sub-optimal.
 So I think a remedy is to implement my own ValueSource extending MultiValueSource that will
decode the geohash into a pair of doubles on initialization.  It would do this using a CachedArrayCreator
implementation of my design.  I don't think I can/should use VectorValueSource since that
one is predicated on being composed of multiple other value sources which is not my scenario.
 Unfortunately my proposed ValueSource subclass cannot simultaneously subclass both MultiValueSource
and FieldCacheSource but the latter doesn't appear to really be necessary.  Actually I'm surprised
MultiValueSource isn't an interface since it only has an abstract method.

Another aspect to this problem is that geohashes support multiple points per document.  I
intend to subclass DocValues() with a method that will return an array of simple objects holding
the pair.  If someone has hints as to some issues/problems with this approach then please
let me know.

Bill Bell, if you're reading this, I know you did a patch attached to SOLR-2155 for sorting
but it uses separate fields to hold the lat & lon for sorting and I'm trying to fix this.

~ David Smiley
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message