lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <>
Subject Re: Tuning caching of geofilt queries
Date Thu, 09 Aug 2012 16:00:37 GMT

: My question is: Does it make sense to round these coordinates (a) while
: indexing and/or (b) while querying to optimize cache hits? Our maximum
: required resolution for geo queries is 1km and we can tolerate minor errors
: so I could round to two decimal points for most of our queries.

: fq=_query_:"{!geofilt sfield=user.location_p pt=48.19815,16.3943
: > d=50.0}"&sfield=user.location_p&pt=48.1981,16.394

1) i don't see any reason for the _query_ hack ... this 
should be more efficient, and easier on the eyes...

 fq={!geofilt sfield=user.location_p pt=48.19815,16.3943 d=50.0}

2) as Erick mentioned, rounding will only do you good if you expect 
lots of queries from differnet users that when rounded, result in the same 

3) you might consider disabling the caching of your geofilt queries 
completley using the cache=false param. for {!geofilt} you should also be 
able to combine this with the "cost" localparm to take advantage of 
post-filtering, so that the distance calculations are only computed for 
documents that already match your query and other cached filters...

4) something you also might wnat to consider (depending on your data and 
how much geo surface area you are dealing with) is along the lines of 
Erick's bounding box suggestion: use two filters; a "course" 
bounding box that you cache, and a precise geofilt using teh cache & cost 
params mentioned in #3.

that way you have a fininite number of bounding box filters that will be 
cached and help quickly prune the total result set down, and then only for 
the results inside that bounding box will the distance calculations for 
your {!geofilt} filter be applied.  (just make sure your bounding boxes 
overlap by at least as much as the max radius you search on, or you migh 
miss results when your search point is close to the edge of your grid)


View raw message