On Jan 31, 2007, at 6:21 AM, Bob Aman wrote:

> And for the search query, so far, I've been using acts_as_ferret's
> find_by_contents method.  But now I need to figure out how to take an
> array of results from the range query, and only do the  
> find_by_contents
> magic on just the entries in that Array.  So far, everything method  
> I've
> thought of looks like it's going to have performance problems.
>
> Any suggestions?

Bob- I don't know what would be involved in using this method with  
aaf, but I am using this method for a bounding box geo query. If you  
need a more strict radial search you can use a custom filter with  
0.10.x.

During index population I'm doing:

doc << Field.new("latitude", latitude.to_f + 1000,
   Field::Store::NO, Field::Index::UNTOKENIZED)
doc << Field.new("longitude", longitude.to_f + 1000,
   Field::Store::NO, Field::Index::UNTOKENIZED)

and during the query I'm doing:

query << "latitude:[#{box[:lat_min] + 1000} #{box[:lat_max] + 1000}]  
AND "
query << "longitude:[#{box[:lon_min] + 1000} #{box[:lon_max] + 1000}]  
AND "

I have helper methods outside of this scope to handle the min/max  
that I'm searching in. I also have a complete (yet untested)  
GeoFilter, but we aren't using the .10.x Ferret yet so I have no idea  
if it actually works.

Michael-
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk

Reply via email to