couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gabor Ratky <>
Subject Re: how to get documents by two or more keys?
Date Thu, 31 Mar 2011 15:34:22 GMT
Look at GeoCouch, geohashing or use Solr as an external indexing service that also supports
geohashes. While these are made for Earthly coordinates, I don't see a reason why it couldn't
work for your purposes.

You could adapt a simple geohashing algorithm for your own problem which would result in the
kind of index you can query.

GeoCouch: (geocouch fork - Couchbase releases include the functionality),CouchDB,Python,geo


Spatial Lucene & Solr:

Good luck and if you have concrete questions, shoot!


On Mar 31, 2011, at 5:19 PM, Nebu Pookins wrote:

> On Tue, Mar 29, 2011 at 1:06 PM, Gabor Ratky
> <> wrote:
>> you can always come up with 'smart' complex keys where the data you need ends up
together, one query away.
> What would the smart key be for this scenario?
> Your documents have represent entities on an infinite 2D field, and
> each document has an attribute representing their X and Y coordinates,
> among other things.
> You wish to find only the entities that are within the rectilinear
> rectangle defined by the top left corner (x1,y1) and bottom-right
> corner (x2,y2); or equivalently by its top-left corner and its width
> and height.
> I've been trying to think of a mapping of the points on a 2D plane to
> a 1D line, that would map the opposite corners of the rectangle as
> opposite endpoints of a line, but I haven't been able to find any such
> mapping that works for arbitrary coordinates of the rectangle.
> - Nebu

View raw message