David Balmain wrote:
> On 9/20/06, Clare <[EMAIL PROTECTED]> wrote:
<SNIP>
> 
> You'll have to work out what is going on here yourself though. I have
> no time for explanation. Note that this won't perform very well
> compared to the padded field version because so much is going on in
> the Ruby code. I could possibly be persuaded to implement this in C.
> 
> Cheers,
> Dave
</SNIP>

I've also implemented a geographic search using lucene/ferret. There a 
couple of key points that helped me 'get it' -

1 - lucene does lexographic, not numeric, search so to search on numbers 
you need to convert them to a string which works for lexographic sort 
(usually by adding leading zeros or a fixed number of decimal places 
after the decimal point) [as pointed out by Dave above]

2 - a range search is actually converted into a boolean search 
internally (someone please correct me if I got that wrong) so doing a 
range search over massive ranges may be problematic by exceeding 
accepted query lengths. Then you start a trade off between accuracy 
(more decimal places) and speed. The way I got round it was to assume 
that for my purposes search only needed to be accurate to about 100m so 
formatting longitude/latitude to 3 decimal places would work fine (I 
live in a small country :)

Sam

-- 
Posted via http://www.ruby-forum.com/.
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk

Reply via email to