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