On 7/19/06, Jordan Frank <[EMAIL PROTECTED]> wrote:
> On 7/18/06, Jordan Frank <[EMAIL PROTECTED]> wrote:
> >
> > Well, because I am a fool, and did not notice this class that seems to
> > be exactly what I need.
> >
> > --
> > Cheers,
> > Jordan Frank
> > [EMAIL PROTECTED]
> >
>
> Actually, I spoke too soon. It appears that this class has the same
> problem with negative numbers. For example:
>
> >> Person.search("latitude_string:[00000000000000 0000000000nesr]").length
> => 7
> >> Person.search("latitude_string:[-1y2p0ij321x6p 0000000000nesr]").length
> => 0
>
> I've expanded my range, so shouldn't the number of results be at least
> what it was with all 0's? I've tried with quotes too, and it doesn't
> help. Again though, if I do the following (note the quotes):
>
> >> Person.search("latitude_string:(> '-1y2p0ij321x6p' AND <
> 0000000000nesr").length
> => 7
>
> It works...
>
> So what i've done, is because I'm only working with longitudes and
> latitudes, which are guaranteed to lie between -500 and 500, I'm just
> adding 500 to them, to make them all positive, and then I can use the
> range queries...and I wrote my own little number to string thing,
> since I'm working with small values. But nevertheless I thank you for
> your help.This seems like the best solution at the moment. I'd forgotten about NumTools. It's probably one of the first modules I ever wrote in Ruby. Anyway, it looks like it might need an upgrade. I'll try and fix it so that it can handle negative numbers. In C this would be a no-brainer but Ruby's BigNums make it a little difficult. I might put the challenge to the Ruby mailing list. Cheers, Dave _______________________________________________ Ferret-talk mailing list [email protected] http://rubyforge.org/mailman/listinfo/ferret-talk

